private void loadConfig(final ConfigProperties systemConfig) { config.load(systemConfig); if (config.httpProxyIsDefined()) { setupProxyAuthentication(); } }
private void setupGitSSH() { if (config.isSshEnabled()) { buildAndStartSSH(); } else { gitSSHService = null; } }
@Override public void dispose() { if (!isClosed) { close(); } provider.onDisposeFileSystem(this); }
@Override public FileStore getFileStore(final Path path) throws IOException, SecurityException { checkNotNull("path", path); return new JGitFileStore(toPathImpl(path).getFileSystem().getGit().getRepository()); }
@Override public InputStream newInputStream(final Path path, final OpenOption... options) throws IllegalArgumentException, UnsupportedOperationException, NoSuchFileException, IOException, SecurityException { checkNotNull("path", path); final JGitPathImpl gPath = toPathImpl(path); return resolveInputStream(gPath.getFileSystem().gitRepo(), gPath.getRefTree(), gPath.getPath()); }
@Override public BasicFileAttributes readAttributes() throws IOException { if (attrs == null) { attrs = buildAttrs(path.getFileSystem(), path.getRefTree(), path.getPath()); } return attrs; }
@Override public HiddenAttributes readAttributes() throws IOException { if (attrs == null) { attrs = buildAttrs(path.getFileSystem(), path.getRefTree(), path.getPath()); } return attrs; }
@Override public VersionAttributes readAttributes() throws IOException { if (attrs == null) { attrs = buildAttrs(path.getFileSystem(), path.getRefTree(), path.getPath()); } return attrs; }
public boolean deleteBranchIfExists(final JGitPathImpl path) { final Ref branch = getBranch(path.getFileSystem().gitRepo(), path.getRefTree()); if (branch == null) { return false; } JGitUtil.deleteBranch(path.getFileSystem().gitRepo(), branch); return true; }
@Override public FileStore getFileStore(final Path path) throws IOException, SecurityException { checkNotNull("path", path); return new JGitFileStore(toPathImpl(path).getFileSystem().gitRepo().getRepository()); }
private boolean hasSameFileSystem(final JGitPathImpl source, final JGitPathImpl target) { return source.getFileSystem().equals(target); }
public static JGitPathImpl create(final JGitFileSystem fs, final String path, final String host, final boolean isRealPath) { return new JGitPathImpl(fs, setupPath(path), setupHost(host), null, false, isRealPath, false); }
JGitFileSystemLock createLock(Git git) { return new JGitFileSystemLock(git, config.getDefaultJgitCacheEvictThresholdTimeUnit(), config.getJgitCacheEvictThresholdDuration()); }
private void setupConfigs(ConfigProperties gitPrefs) { config = new JGitFileSystemProviderConfiguration(); loadConfig(gitPrefs); }
@Override public String getSegmentId() { return getRefTree(); } }
private void setupDaemon() { if (config.isDaemonEnabled()) { buildAndStartDaemon(); } else { daemonService = null; } }
public static JGitPathImpl createFSDirect(final JGitFileSystem fs) { return new JGitPathImpl(fs, null, null, null, true, true, true); }
@Override public Set<String> supportedFileAttributeViews() { checkClose(); return SUPPORTED_ATTR_VIEWS; }
@Override public Set<String> supportedFileAttributeViews() { checkClosed(); return SUPPORTED_ATTR_VIEWS; }
@Override public void setBatchCommitInfo(final String defaultMessage, final CommentedOption op) { this.batchCommitInfo = buildCommitInfo(defaultMessage, op); }