Class MockFileStore

  • All Implemented Interfaces:
    FileStore

    public class MockFileStore
    extends Object
    implements FileStore
    In-memory FileStore.
    Author:
    Alex Bogdanovski [alex@erudika.com]
    • Constructor Detail

      • MockFileStore

        public MockFileStore()
    • Method Detail

      • load

        public InputStream load​(String path)
        Description copied from interface: FileStore
        Loads a file from a storage service.
        Specified by:
        load in interface FileStore
        Parameters:
        path - the relative file path
        Returns:
        the file stream or null if not found
      • store

        public String store​(String path,
                            InputStream data)
        Description copied from interface: FileStore
        Saves a file to a storage service.
        Specified by:
        store in interface FileStore
        Parameters:
        path - the relative file path
        data - the contents of the file
        Returns:
        the full path to the file or the URL, null if unsuccessful
      • delete

        public boolean delete​(String path)
        Description copied from interface: FileStore
        Deletes a file.
        Specified by:
        delete in interface FileStore
        Parameters:
        path - the relative file path
        Returns:
        true if successful