private final String acl;
/** Maximum number of times to try an operation. */
- private final int maxAttempts;
+ final int maxAttempts;
/** Encryption algorithm, may be a null instance that provides pass-through. */
private final WalkEncryption encryption;
return encryption.encrypt(new DigestOutputStream(buffer, md5));
}
- private void putImpl(final String bucket, final String key,
+ void putImpl(final String bucket, final String key,
final byte[] csum, final TemporaryBuffer buf,
ProgressMonitor monitor, String monitorTask) throws IOException {
if (monitor == null)
throw maxAttempts(JGitText.get().s3ActionWriting, key);
}
- private IOException error(final String action, final String key,
+ IOException error(final String action, final String key,
final HttpURLConnection c) throws IOException {
final IOException err = new IOException(MessageFormat.format(
JGitText.get().amazonS3ActionFailed, action, key,
return err;
}
- private IOException maxAttempts(final String action, final String key) {
+ IOException maxAttempts(final String action, final String key) {
return new IOException(MessageFormat.format(
JGitText.get().amazonS3ActionFailedGivingUp, action, key,
Integer.valueOf(maxAttempts)));
return open(method, bucket, key, noArgs);
}
- private HttpURLConnection open(final String method, final String bucket,
+ HttpURLConnection open(final String method, final String bucket,
final String key, final Map<String, String> args)
throws IOException {
final StringBuilder urlstr = new StringBuilder();
return c;
}
- private void authorize(final HttpURLConnection c) throws IOException {
+ void authorize(final HttpURLConnection c) throws IOException {
final Map<String, List<String>> reqHdr = c.getRequestProperties();
final SortedMap<String, String> sigHdr = new TreeMap<String, String>();
for (final Map.Entry<String, List<String>> entry : reqHdr.entrySet()) {
private boolean run;
- private Thread acceptThread;
+ Thread acceptThread;
private int timeout;
private volatile RepositoryResolver<DaemonClient> repositoryResolver;
- private volatile UploadPackFactory<DaemonClient> uploadPackFactory;
+ volatile UploadPackFactory<DaemonClient> uploadPackFactory;
- private volatile ReceivePackFactory<DaemonClient> receivePackFactory;
+ volatile ReceivePackFactory<DaemonClient> receivePackFactory;
/** Configure a daemon to listen on any available network port. */
public Daemon() {
}
}
- private void startClient(final Socket s) {
+ void startClient(final Socket s) {
final DaemonClient dc = new DaemonClient(this);
final SocketAddress peer = s.getRemoteSocketAddress();
* to the constructor.
*/
public class JschSession implements RemoteSession {
- private final Session sock;
- private final URIish uri;
+ final Session sock;
+ final URIish uri;
/**
* Create a new session object by passing the real Jsch session and the URI
private class JschProcess extends Process {
private ChannelExec channel;
- private final int timeout;
+ final int timeout;
private InputStream inputStream;
* @throws IOException
* on problems opening streams
*/
- private JschProcess(final String commandName, int tms)
+ JschProcess(final String commandName, int tms)
throws TransportException, IOException {
timeout = tms;
try {
private InputStream in;
- private byte[] buf;
+ byte[] buf;
/** Position in the input stream of {@code buf[0]}. */
private long bBase;
private int bOffset;
- private int bAvail;
+ int bAvail;
private ObjectChecker objCheck;
}
// Consume cnt bytes from the buffer.
- private void use(final int cnt) {
+ void use(final int cnt) {
bOffset += cnt;
bAvail -= cnt;
}
// Ensure at least need bytes are available in in {@link #buf}.
- private int fill(final Source src, final int need) throws IOException {
+ int fill(final Source src, final int need) throws IOException {
while (bAvail < need) {
int next = bOffset + bAvail;
int free = buf.length - next;
Constants.R_REFS + "meta/push-certs"; //$NON-NLS-1$
private static class PendingCert {
- private PushCertificate cert;
- private PersonIdent ident;
- private Collection<ReceiveCommand> matching;
+ PushCertificate cert;
+ PersonIdent ident;
+ Collection<ReceiveCommand> matching;
- private PendingCert(PushCertificate cert, PersonIdent ident,
+ PendingCert(PushCertificate cert, PersonIdent ident,
Collection<ReceiveCommand> matching) {
this.cert = cert;
this.ident = ident;
private final Repository db;
private final List<PendingCert> pending;
- private ObjectReader reader;
- private RevCommit commit;
+ ObjectReader reader;
+ RevCommit commit;
/**
* Create a new store backed by the given repository.
};
}
- private void load() throws IOException {
+ void load() throws IOException {
close();
reader = db.newObjectReader();
Ref ref = db.getRefDatabase().exactRef(REF_NAME);
}
}
- private static PushCertificate read(TreeWalk tw) throws IOException {
+ static PushCertificate read(TreeWalk tw) throws IOException {
if (tw == null || (tw.getRawMode(0) & TYPE_FILE) != TYPE_FILE) {
return null;
}
return TreeWalk.forPath(reader, pathName(refName), commit.getTree());
}
- private static String pathName(String refName) {
+ static String pathName(String refName) {
return refName + "@{cert}"; //$NON-NLS-1$
}
private static final String SCHEME = "test"; //$NON-NLS-1$
private class Handle {
- private final C req;
- private final Repository remote;
+ final C req;
+ final Repository remote;
- private Handle(C req, Repository remote) {
+ Handle(C req, Repository remote) {
this.req = req;
this.remote = remote;
}
}
- private final UploadPackFactory<C> uploadPackFactory;
- private final ReceivePackFactory<C> receivePackFactory;
+ final UploadPackFactory<C> uploadPackFactory;
+ final ReceivePackFactory<C> receivePackFactory;
private final HashMap<URIish, Handle> handles;
/**
private class TransportInternal extends Transport implements PackTransport {
private final Handle handle;
- private TransportInternal(Repository local, URIish uri, Handle handle) {
+ TransportInternal(Repository local, URIish uri, Handle handle) {
super(local, uri);
this.handle = handle;
}
/** Update of a locally stored tracking branch. */
public class TrackingRefUpdate {
private final String remoteName;
- private final String localName;
- private boolean forceUpdate;
- private ObjectId oldObjectId;
- private ObjectId newObjectId;
+ final String localName;
+ boolean forceUpdate;
+ ObjectId oldObjectId;
+ ObjectId newObjectId;
private RefUpdate.Result result;
private ReceiveCommand cmd;
}
final class Command extends ReceiveCommand {
- private Command() {
+ Command() {
super(oldObjectId, newObjectId, localName);
}
private final boolean safeForMacOS;
private final boolean allowTipSha1InWant;
private final boolean allowReachableSha1InWant;
- private final String[] hideRefs;
+ final String[] hideRefs;
TransferConfig(final Repository db) {
this(db.getConfig());
}
- private TransferConfig(final Config rc) {
+ TransferConfig(final Config rc) {
checkReceivedObjects = rc.getBoolean(
"fetch", "fsckobjects", //$NON-NLS-1$ //$NON-NLS-2$
rc.getBoolean("transfer", "fsckobjects", false)); //$NON-NLS-1$ //$NON-NLS-2$
};
/** User information necessary to connect to S3. */
- private final AmazonS3 s3;
+ final AmazonS3 s3;
/** Bucket the remote repository is stored in. */
- private final String bucket;
+ final String bucket;
/**
* Key prefix which all objects related to the repository start with.
sslVerify = rc.getBoolean("http", "sslVerify", true); //$NON-NLS-1$ //$NON-NLS-2$
}
- private HttpConfig() {
+ HttpConfig() {
this(new Config());
}
}
- private final URL baseUrl;
+ final URL baseUrl;
private final URL objectsUrl;
- private final HttpConfig http;
+ final HttpConfig http;
private final ProxySelector proxySelector;
*/
class WalkFetchConnection extends BaseFetchConnection {
/** The repository this transport fetches into, or pushes out of. */
- private final Repository local;
+ final Repository local;
/** If not null the validator for received objects. */
- private final ObjectChecker objCheck;
+ final ObjectChecker objCheck;
/**
* List of all remote repositories we may need to get objects out of.
*/
private final HashMap<ObjectId, List<Throwable>> fetchErrors;
- private String lockMessage;
+ String lockMessage;
- private final List<PackLock> packLocks;
+ final List<PackLock> packLocks;
/** Inserter to write objects onto {@link #local}. */
- private final ObjectInserter inserter;
+ final ObjectInserter inserter;
/** Inserter to read objects from {@link #local}. */
private final ObjectReader reader;
private final URIish uri;
/** Database connection to the remote repository. */
- private final WalkRemoteObjectDatabase dest;
+ final WalkRemoteObjectDatabase dest;
/** The configured transport we were constructed by. */
private final Transport transport;