Class MemoryFileSystem

  • All Implemented Interfaces:
    org.apache.jackrabbit.core.fs.FileSystem

    public class MemoryFileSystem
    extends Object
    implements org.apache.jackrabbit.core.fs.FileSystem
    An in-memory file system implementation.
    • Constructor Detail

      • MemoryFileSystem

        public MemoryFileSystem()
    • Method Detail

      • close

        public void close()
        Specified by:
        close in interface org.apache.jackrabbit.core.fs.FileSystem
      • createFolder

        public void createFolder​(String folderPath)
                          throws org.apache.jackrabbit.core.fs.FileSystemException
        Specified by:
        createFolder in interface org.apache.jackrabbit.core.fs.FileSystem
        Throws:
        org.apache.jackrabbit.core.fs.FileSystemException
      • deleteFile

        public void deleteFile​(String filePath)
                        throws org.apache.jackrabbit.core.fs.FileSystemException
        Specified by:
        deleteFile in interface org.apache.jackrabbit.core.fs.FileSystem
        Throws:
        org.apache.jackrabbit.core.fs.FileSystemException
      • deleteFolder

        public void deleteFolder​(String folderPath)
                          throws org.apache.jackrabbit.core.fs.FileSystemException
        Specified by:
        deleteFolder in interface org.apache.jackrabbit.core.fs.FileSystem
        Throws:
        org.apache.jackrabbit.core.fs.FileSystemException
      • exists

        public boolean exists​(String path)
                       throws org.apache.jackrabbit.core.fs.FileSystemException
        Specified by:
        exists in interface org.apache.jackrabbit.core.fs.FileSystem
        Throws:
        org.apache.jackrabbit.core.fs.FileSystemException
      • getInputStream

        public InputStream getInputStream​(String filePath)
                                   throws org.apache.jackrabbit.core.fs.FileSystemException
        Specified by:
        getInputStream in interface org.apache.jackrabbit.core.fs.FileSystem
        Throws:
        org.apache.jackrabbit.core.fs.FileSystemException
      • getOutputStream

        public OutputStream getOutputStream​(String filePath)
                                     throws org.apache.jackrabbit.core.fs.FileSystemException
        Specified by:
        getOutputStream in interface org.apache.jackrabbit.core.fs.FileSystem
        Throws:
        org.apache.jackrabbit.core.fs.FileSystemException
      • hasChildren

        public boolean hasChildren​(String path)
                            throws org.apache.jackrabbit.core.fs.FileSystemException
        Specified by:
        hasChildren in interface org.apache.jackrabbit.core.fs.FileSystem
        Throws:
        org.apache.jackrabbit.core.fs.FileSystemException
      • init

        public void init()
        Specified by:
        init in interface org.apache.jackrabbit.core.fs.FileSystem
      • isFile

        public boolean isFile​(String path)
                       throws org.apache.jackrabbit.core.fs.FileSystemException
        Specified by:
        isFile in interface org.apache.jackrabbit.core.fs.FileSystem
        Throws:
        org.apache.jackrabbit.core.fs.FileSystemException
      • isFolder

        public boolean isFolder​(String path)
                         throws org.apache.jackrabbit.core.fs.FileSystemException
        Specified by:
        isFolder in interface org.apache.jackrabbit.core.fs.FileSystem
        Throws:
        org.apache.jackrabbit.core.fs.FileSystemException
      • lastModified

        public long lastModified​(String path)
                          throws org.apache.jackrabbit.core.fs.FileSystemException
        Specified by:
        lastModified in interface org.apache.jackrabbit.core.fs.FileSystem
        Throws:
        org.apache.jackrabbit.core.fs.FileSystemException
      • length

        public long length​(String filePath)
                    throws org.apache.jackrabbit.core.fs.FileSystemException
        Specified by:
        length in interface org.apache.jackrabbit.core.fs.FileSystem
        Throws:
        org.apache.jackrabbit.core.fs.FileSystemException
      • list

        public String[] list​(String folderPath)
        Specified by:
        list in interface org.apache.jackrabbit.core.fs.FileSystem
      • listFiles

        public String[] listFiles​(String folderPath)
        Specified by:
        listFiles in interface org.apache.jackrabbit.core.fs.FileSystem
      • listFolders

        public String[] listFolders​(String folderPath)
        Specified by:
        listFolders in interface org.apache.jackrabbit.core.fs.FileSystem