Class DummyFileStorage

java.lang.Object
ch.autumo.beetroot.server.modules.file.DummyFileStorage
All Implemented Interfaces:
FileStorage

public class DummyFileStorage extends Object implements FileStorage
Dummy file storage - just an example of a simple file storage; not to be used for serious and productive applications!
  • Field Details

    • LOG

      protected static final org.slf4j.Logger LOG
  • Constructor Details

    • DummyFileStorage

      public DummyFileStorage()
  • Method Details

    • store

      public String store(File file, String name, String user, String domain) throws Exception
      Description copied from interface: FileStorage
      Store a file.
      Specified by:
      store in interface FileStorage
      Parameters:
      file - file
      name - file name
      user - user or null
      domain - domain or null (default)
      Returns:
      unique file ID
      Throws:
      Exception - exception
    • findFile

      public Download findFile(String uniqueFileId, String domain) throws Exception
      Description copied from interface: FileStorage
      Find a file (latest version). The file delivered within the download must be physically temporarily available, so it can be delivered by a stream and the file referenced by the download will ALWAYS be deleted after sending it to the client; so it is necessary to create a temporary file in the download - never reference the original file, e.g. when a real file structure is used as a file storage!
      Specified by:
      findFile in interface FileStorage
      Parameters:
      uniqueFileId - unique file id
      domain - domain or null (default)
      Returns:
      download or null if file is not available
      Throws:
      Exception - exception
    • delete

      public boolean delete(String uniqueFileId, String domain) throws Exception
      Description copied from interface: FileStorage
      Delete a file.
      Specified by:
      delete in interface FileStorage
      Parameters:
      uniqueFileId - unique file id
      domain - domain or null (default)
      Returns:
      true if at least one (of all versions) has been found and deleted
      Throws:
      Exception - exception