Class JimfsSecureDirectoryStream
java.lang.Object
com.google.common.jimfs.JimfsSecureDirectoryStream
- All Implemented Interfaces:
Closeable, AutoCloseable, Iterable<Path>, DirectoryStream<Path>, SecureDirectoryStream<Path>
Secure directory stream implementation that uses a
FileSystemView with the stream's
directory as its working directory.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate final classNested classes/interfaces inherited from interface DirectoryStream
DirectoryStream.Filter<T> -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final DirectoryStream.Filter<Object> A stream filter that always returns true.private final FileSystemStateprivate final DirectoryStream.Filter<? super Path> private booleanprivate final FileSystemView -
Constructor Summary
ConstructorsConstructorDescriptionJimfsSecureDirectoryStream(FileSystemView view, DirectoryStream.Filter<? super Path> filter, FileSystemState fileSystemState) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidprivate static JimfsPathvoidclose()voiddeleteDirectory(Path path) voiddeleteFile(Path path) <V extends FileAttributeView>
VgetFileAttributeView(Class<V> type) <V extends FileAttributeView>
VgetFileAttributeView(Path path, Class<V> type, LinkOption... options) iterator()voidmove(Path srcPath, SecureDirectoryStream<Path> targetDir, Path targetPath) newByteChannel(Path path, Set<? extends OpenOption> options, FileAttribute<?>... attrs) newDirectoryStream(Path path, LinkOption... options) private JimfsPathpath()Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Iterable
forEach, spliterator
-
Field Details
-
view
-
filter
-
fileSystemState
-
open
private boolean open -
iterator
-
ALWAYS_TRUE_FILTER
A stream filter that always returns true.
-
-
Constructor Details
-
JimfsSecureDirectoryStream
public JimfsSecureDirectoryStream(FileSystemView view, DirectoryStream.Filter<? super Path> filter, FileSystemState fileSystemState)
-
-
Method Details
-
path
-
iterator
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-
checkOpen
protected void checkOpen() -
newDirectoryStream
public SecureDirectoryStream<Path> newDirectoryStream(Path path, LinkOption... options) throws IOException - Specified by:
newDirectoryStreamin interfaceSecureDirectoryStream<Path>- Throws:
IOException
-
newByteChannel
public SeekableByteChannel newByteChannel(Path path, Set<? extends OpenOption> options, FileAttribute<?>... attrs) throws IOException - Specified by:
newByteChannelin interfaceSecureDirectoryStream<Path>- Throws:
IOException
-
deleteFile
- Specified by:
deleteFilein interfaceSecureDirectoryStream<Path>- Throws:
IOException
-
deleteDirectory
- Specified by:
deleteDirectoryin interfaceSecureDirectoryStream<Path>- Throws:
IOException
-
move
public void move(Path srcPath, SecureDirectoryStream<Path> targetDir, Path targetPath) throws IOException - Specified by:
movein interfaceSecureDirectoryStream<Path>- Throws:
IOException
-
getFileAttributeView
- Specified by:
getFileAttributeViewin interfaceSecureDirectoryStream<Path>
-
getFileAttributeView
public <V extends FileAttributeView> V getFileAttributeView(Path path, Class<V> type, LinkOption... options) - Specified by:
getFileAttributeViewin interfaceSecureDirectoryStream<Path>
-
checkPath
-