@Override
public <A extends BasicFileAttributes> A readAttributes( final Path path,
final Class<A> type,
final LinkOption... options )
throws NoSuchFileException, UnsupportedOperationException, IOException, SecurityException {
checkNotNull( "path", path );
checkNotNull( "type", type );
final JGitPathImpl gPath = toPathImpl( path );
final Pair<PathType, ObjectId> pathResult = checkPath( gPath.getFileSystem().gitRepo(), gPath.getRefTree(), gPath.getPath() );
if ( pathResult.getK1().equals( NOT_FOUND ) ) {
throw new NoSuchFileException( path.toString() );
}
if ( type == BasicFileAttributesImpl.class || type == BasicFileAttributes.class || type == VersionAttributes.class ) {
final JGitVersionAttributeView view = getFileAttributeView( path, JGitVersionAttributeView.class, options );
return (A) view.readAttributes();
}
return null;
}