Package com.google.common.jimfs
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 class
Nested classes/interfaces inherited from interface java.nio.file.DirectoryStream
DirectoryStream.Filter<T>
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final DirectoryStream.Filter
<Object> A stream filter that always returns true.private final FileSystemState
private final DirectoryStream.Filter
<? super Path> private boolean
private final FileSystemView
-
Constructor Summary
ConstructorsConstructorDescriptionJimfsSecureDirectoryStream
(FileSystemView view, DirectoryStream.Filter<? super Path> filter, FileSystemState fileSystemState) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
private static JimfsPath
void
close()
void
deleteDirectory
(Path path) void
deleteFile
(Path path) <V extends FileAttributeView>
VgetFileAttributeView
(Class<V> type) <V extends FileAttributeView>
VgetFileAttributeView
(Path path, Class<V> type, LinkOption... options) iterator()
void
move
(Path srcPath, SecureDirectoryStream<Path> targetDir, Path targetPath) newByteChannel
(Path path, Set<? extends OpenOption> options, FileAttribute<?>... attrs) newDirectoryStream
(Path path, LinkOption... options) private JimfsPath
path()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.lang.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:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
-
checkOpen
protected void checkOpen() -
newDirectoryStream
public SecureDirectoryStream<Path> newDirectoryStream(Path path, LinkOption... options) throws IOException - Specified by:
newDirectoryStream
in interfaceSecureDirectoryStream<Path>
- Throws:
IOException
-
newByteChannel
public SeekableByteChannel newByteChannel(Path path, Set<? extends OpenOption> options, FileAttribute<?>... attrs) throws IOException - Specified by:
newByteChannel
in interfaceSecureDirectoryStream<Path>
- Throws:
IOException
-
deleteFile
- Specified by:
deleteFile
in interfaceSecureDirectoryStream<Path>
- Throws:
IOException
-
deleteDirectory
- Specified by:
deleteDirectory
in interfaceSecureDirectoryStream<Path>
- Throws:
IOException
-
move
public void move(Path srcPath, SecureDirectoryStream<Path> targetDir, Path targetPath) throws IOException - Specified by:
move
in interfaceSecureDirectoryStream<Path>
- Throws:
IOException
-
getFileAttributeView
- Specified by:
getFileAttributeView
in interfaceSecureDirectoryStream<Path>
-
getFileAttributeView
public <V extends FileAttributeView> V getFileAttributeView(Path path, Class<V> type, LinkOption... options) - Specified by:
getFileAttributeView
in interfaceSecureDirectoryStream<Path>
-
checkPath
-