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, boolean isRealPath ) { return new JGitPathImpl( fs, setupPath( path ), setupHost( host ), null, false, isRealPath, false ); }
protected boolean exists( final Path path ) { try { readAttributes( path, BasicFileAttributes.class ); return true; } catch ( final Exception ignored ) { } return false; }
@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() ); }
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; }
private void createBranch( final JGitPathImpl source, final JGitPathImpl target ) { JGitUtil.createBranch( source.getFileSystem().gitRepo(), source.getRefTree(), target.getRefTree() ); }
private boolean existsBranch( final JGitPathImpl path ) { return hasBranch( path.getFileSystem().gitRepo(), path.getRefTree() ); }
@Override public FileStore getFileStore( final Path path ) throws IOException, SecurityException { checkNotNull( "path", path ); return new JGitFileStore( toPathImpl( path ).getFileSystem().gitRepo().getRepository() ); }
public boolean isRegularFile() throws IllegalAccessError, SecurityException { try { return getFileSystem().provider().readAttributes( this, BasicFileAttributes.class ).isRegularFile(); } catch ( IOException ioe ) { } return false; }
private ExtendedAttributeView getFileAttributeView( final JGitPathImpl path, final String name, final LinkOption... options ) { final ExtendedAttributeView view = path.getAttrView( name ); if ( view == null && ( name.equals( "basic" ) || name.equals( "version" ) ) ) { final JGitVersionAttributeView newView = new JGitVersionAttributeView( path ); path.addAttrView( newView ); return newView; } return view; }
@Override public String getSegmentId() { return getRefTree(); } }
protected Git setupGit() throws IOException, GitAPIException { return setupGit( createTempDirectory() ); }
@Override protected Path newRoot( final JGitFileSystem fs, String substring, final String host, boolean realPath ) { return new JGitPathImpl( fs, substring, host, null, true, realPath, true ); }
@Override public String toString() { return "WatchService{" + "FileSystem=" + JGitFileSystem.this.toString() + '}'; } };
@Override public Set<String> supportedFileAttributeViews() { checkClose(); return SUPPORTED_ATTR_VIEWS; }
public void deleteBranch( final JGitPathImpl path ) { final Ref branch = getBranch( path.getFileSystem().gitRepo(), path.getRefTree() ); if ( branch == null ) { throw new NoSuchFileException( path.toString() ); } JGitUtil.deleteBranch( path.getFileSystem().gitRepo(), branch ); }
public static JGitPathImpl createRoot( final JGitFileSystem fs, final String path, final String host, boolean isRealPath ) { return new JGitPathImpl( fs, setupPath( path ), setupHost( host ), null, true, isRealPath, true ); }
@Override protected Path newPath( final JGitFileSystem fs, final String substring, final String host, final boolean isRealPath, final boolean isNormalized ) { return new JGitPathImpl( fs, substring, host, null, false, isRealPath, isNormalized ); }
public static JGitPathImpl createFSDirect( final JGitFileSystem fs ) { return new JGitPathImpl( fs, null, null, null, true, true, true ); }