Class StdInOutFileSystem

  • All Implemented Interfaces:
    FileSystem

    public class StdInOutFileSystem
    extends java.lang.Object
    implements FileSystem
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String SCHEME  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean canRead​(java.lang.String filename)
      returns true if filename can be read
      boolean canWrite​(java.lang.String filename)
      returns true if filename can be written to
      byte capabilities()
      capabilities of the filesystem
      boolean delete​(java.lang.String filename)
      delete the named file
      boolean deleteOnExit​(java.lang.String pathname)
      delete the file after the JVM exits
      boolean exists​(java.lang.String filename)
      returns true if the path exists
      java.lang.String getParent​(java.lang.String path)
      whats the parent path to this path - eg directory containing a file
      boolean isDirectory​(java.lang.String path)
      returns true if path is a directory
      long length​(java.lang.String filename)
      returns the length of the specified file
      java.lang.String[] list​(java.lang.String path)
      list contents of a directory etc
      boolean mkdir​(java.lang.String filename)
      mkdir the specified path
      java.lang.String name()
      returns a name for the filesystem
      RandomDataInput openFileRandom​(java.lang.String filename)
      open a file for random input
      java.io.InputStream openFileStream​(java.lang.String filename)
      open a file of given filename for readinng
      boolean rename​(java.lang.String source, java.lang.String destination)
      rename a file/dir to another name, on the same file system
      java.lang.String[] schemes()
      URI schemes supported by this class
      RandomDataOutput writeFileRandom​(java.lang.String filename)
      open a file of given filename for random writing
      java.io.OutputStream writeFileStream​(java.lang.String filename)
      open a file of given filename for writing
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • StdInOutFileSystem

        public StdInOutFileSystem()
    • Method Detail

      • name

        public java.lang.String name()
        Description copied from interface: FileSystem
        returns a name for the filesystem
        Specified by:
        name in interface FileSystem
      • capabilities

        public byte capabilities()
        Description copied from interface: FileSystem
        capabilities of the filesystem
        Specified by:
        capabilities in interface FileSystem
      • schemes

        public java.lang.String[] schemes()
        Description copied from interface: FileSystem
        URI schemes supported by this class
        Specified by:
        schemes in interface FileSystem
      • exists

        public boolean exists​(java.lang.String filename)
                       throws java.io.IOException
        Description copied from interface: FileSystem
        returns true if the path exists
        Specified by:
        exists in interface FileSystem
        Throws:
        java.io.IOException
      • canRead

        public boolean canRead​(java.lang.String filename)
                        throws java.io.IOException
        Description copied from interface: FileSystem
        returns true if filename can be read
        Specified by:
        canRead in interface FileSystem
        Throws:
        java.io.IOException
      • canWrite

        public boolean canWrite​(java.lang.String filename)
                         throws java.io.IOException
        Description copied from interface: FileSystem
        returns true if filename can be written to
        Specified by:
        canWrite in interface FileSystem
        Throws:
        java.io.IOException
      • openFileStream

        public java.io.InputStream openFileStream​(java.lang.String filename)
                                           throws java.io.IOException
        Description copied from interface: FileSystem
        open a file of given filename for readinng
        Specified by:
        openFileStream in interface FileSystem
        Throws:
        java.io.IOException
      • openFileRandom

        public RandomDataInput openFileRandom​(java.lang.String filename)
                                       throws java.io.IOException
        Description copied from interface: FileSystem
        open a file for random input
        Specified by:
        openFileRandom in interface FileSystem
        Throws:
        java.io.IOException
      • writeFileStream

        public java.io.OutputStream writeFileStream​(java.lang.String filename)
                                             throws java.io.IOException
        Description copied from interface: FileSystem
        open a file of given filename for writing
        Specified by:
        writeFileStream in interface FileSystem
        Throws:
        java.io.IOException
      • writeFileRandom

        public RandomDataOutput writeFileRandom​(java.lang.String filename)
                                         throws java.io.IOException
        Description copied from interface: FileSystem
        open a file of given filename for random writing
        Specified by:
        writeFileRandom in interface FileSystem
        Throws:
        java.io.IOException
      • delete

        public boolean delete​(java.lang.String filename)
                       throws java.io.IOException
        Description copied from interface: FileSystem
        delete the named file
        Specified by:
        delete in interface FileSystem
        Throws:
        java.io.IOException
      • deleteOnExit

        public boolean deleteOnExit​(java.lang.String pathname)
                             throws java.io.IOException
        Description copied from interface: FileSystem
        delete the file after the JVM exits
        Specified by:
        deleteOnExit in interface FileSystem
        Throws:
        java.io.IOException
      • mkdir

        public boolean mkdir​(java.lang.String filename)
                      throws java.io.IOException
        Description copied from interface: FileSystem
        mkdir the specified path
        Specified by:
        mkdir in interface FileSystem
        Throws:
        java.io.IOException
      • length

        public long length​(java.lang.String filename)
                    throws java.io.IOException
        Description copied from interface: FileSystem
        returns the length of the specified file
        Specified by:
        length in interface FileSystem
        Throws:
        java.io.IOException
      • isDirectory

        public boolean isDirectory​(java.lang.String path)
                            throws java.io.IOException
        Description copied from interface: FileSystem
        returns true if path is a directory
        Specified by:
        isDirectory in interface FileSystem
        Throws:
        java.io.IOException
      • rename

        public boolean rename​(java.lang.String source,
                              java.lang.String destination)
                       throws java.io.IOException
        Description copied from interface: FileSystem
        rename a file/dir to another name, on the same file system
        Specified by:
        rename in interface FileSystem
        Throws:
        java.io.IOException
      • getParent

        public java.lang.String getParent​(java.lang.String path)
                                   throws java.io.IOException
        Description copied from interface: FileSystem
        whats the parent path to this path - eg directory containing a file
        Specified by:
        getParent in interface FileSystem
        Throws:
        java.io.IOException
      • list

        public java.lang.String[] list​(java.lang.String path)
                                throws java.io.IOException
        Description copied from interface: FileSystem
        list contents of a directory etc
        Specified by:
        list in interface FileSystem
        Throws:
        java.io.IOException