@ Nullable private RegularFile lookUpRegularFile ( JimfsPath path , Set < OpenOption > options ) throws IOException { store . readLock ( ) . lock ( ) ; try { DirectoryEntry entry = lookUp ( path , options ) ; if ( entry . exists ( ) ) { File file = entry . file ( ) ; if ( ! file . isRegularFile ( ) ) { throw new FileSystemException ( path . toString ( ) , null , "not a regular file" ) ; } return open ( ( RegularFile ) file , options ) ; } else { return null ; } } finally { store . readLock ( ) . unlock ( ) ; } }
Looks up the regular file at the given path throwing an exception if the file isn t a regular file . Returns null if the file did not exist .