Class JimfsSecureDirectoryStream

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable, java.lang.Iterable<java.nio.file.Path>, java.nio.file.DirectoryStream<java.nio.file.Path>, java.nio.file.SecureDirectoryStream<java.nio.file.Path>

    final class JimfsSecureDirectoryStream
    extends java.lang.Object
    implements java.nio.file.SecureDirectoryStream<java.nio.file.Path>
    Secure directory stream implementation that uses a FileSystemView with the stream's directory as its working directory.
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      private class  JimfsSecureDirectoryStream.DirectoryIterator  
      • Nested classes/interfaces inherited from interface java.nio.file.DirectoryStream

        java.nio.file.DirectoryStream.Filter<T extends java.lang.Object>
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected void checkOpen()  
      private static JimfsPath checkPath​(java.nio.file.Path path)  
      void close()  
      void deleteDirectory​(java.nio.file.Path path)  
      void deleteFile​(java.nio.file.Path path)  
      <V extends java.nio.file.attribute.FileAttributeView>
      V
      getFileAttributeView​(java.lang.Class<V> type)  
      <V extends java.nio.file.attribute.FileAttributeView>
      V
      getFileAttributeView​(java.nio.file.Path path, java.lang.Class<V> type, java.nio.file.LinkOption... options)  
      java.util.Iterator<java.nio.file.Path> iterator()  
      void move​(java.nio.file.Path srcPath, java.nio.file.SecureDirectoryStream<java.nio.file.Path> targetDir, java.nio.file.Path targetPath)  
      java.nio.channels.SeekableByteChannel newByteChannel​(java.nio.file.Path path, java.util.Set<? extends java.nio.file.OpenOption> options, java.nio.file.attribute.FileAttribute<?>... attrs)  
      java.nio.file.SecureDirectoryStream<java.nio.file.Path> newDirectoryStream​(java.nio.file.Path path, java.nio.file.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 Detail

      • filter

        private final java.nio.file.DirectoryStream.Filter<? super java.nio.file.Path> filter
      • open

        private boolean open
      • iterator

        private java.util.Iterator<java.nio.file.Path> iterator
      • ALWAYS_TRUE_FILTER

        public static final java.nio.file.DirectoryStream.Filter<java.lang.Object> ALWAYS_TRUE_FILTER
        A stream filter that always returns true.
    • Constructor Detail

      • JimfsSecureDirectoryStream

        public JimfsSecureDirectoryStream​(FileSystemView view,
                                          java.nio.file.DirectoryStream.Filter<? super java.nio.file.Path> filter,
                                          FileSystemState fileSystemState)
    • Method Detail

      • iterator

        public java.util.Iterator<java.nio.file.Path> iterator()
        Specified by:
        iterator in interface java.nio.file.DirectoryStream<java.nio.file.Path>
        Specified by:
        iterator in interface java.lang.Iterable<java.nio.file.Path>
      • close

        public void close()
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
      • checkOpen

        protected void checkOpen()
      • newDirectoryStream

        public java.nio.file.SecureDirectoryStream<java.nio.file.Path> newDirectoryStream​(java.nio.file.Path path,
                                                                                          java.nio.file.LinkOption... options)
                                                                                   throws java.io.IOException
        Specified by:
        newDirectoryStream in interface java.nio.file.SecureDirectoryStream<java.nio.file.Path>
        Throws:
        java.io.IOException
      • newByteChannel

        public java.nio.channels.SeekableByteChannel newByteChannel​(java.nio.file.Path path,
                                                                    java.util.Set<? extends java.nio.file.OpenOption> options,
                                                                    java.nio.file.attribute.FileAttribute<?>... attrs)
                                                             throws java.io.IOException
        Specified by:
        newByteChannel in interface java.nio.file.SecureDirectoryStream<java.nio.file.Path>
        Throws:
        java.io.IOException
      • deleteFile

        public void deleteFile​(java.nio.file.Path path)
                        throws java.io.IOException
        Specified by:
        deleteFile in interface java.nio.file.SecureDirectoryStream<java.nio.file.Path>
        Throws:
        java.io.IOException
      • deleteDirectory

        public void deleteDirectory​(java.nio.file.Path path)
                             throws java.io.IOException
        Specified by:
        deleteDirectory in interface java.nio.file.SecureDirectoryStream<java.nio.file.Path>
        Throws:
        java.io.IOException
      • move

        public void move​(java.nio.file.Path srcPath,
                         java.nio.file.SecureDirectoryStream<java.nio.file.Path> targetDir,
                         java.nio.file.Path targetPath)
                  throws java.io.IOException
        Specified by:
        move in interface java.nio.file.SecureDirectoryStream<java.nio.file.Path>
        Throws:
        java.io.IOException
      • getFileAttributeView

        public <V extends java.nio.file.attribute.FileAttributeView> V getFileAttributeView​(java.lang.Class<V> type)
        Specified by:
        getFileAttributeView in interface java.nio.file.SecureDirectoryStream<java.nio.file.Path>
      • getFileAttributeView

        public <V extends java.nio.file.attribute.FileAttributeView> V getFileAttributeView​(java.nio.file.Path path,
                                                                                            java.lang.Class<V> type,
                                                                                            java.nio.file.LinkOption... options)
        Specified by:
        getFileAttributeView in interface java.nio.file.SecureDirectoryStream<java.nio.file.Path>
      • checkPath

        private static JimfsPath checkPath​(java.nio.file.Path path)