java.lang.Object
overit.geocallapp.docshare.documents.bl.sharedresource.file.savingstrategy.SavingStrategy
overit.geocallapp.docshare.documents.bl.sharedresource.file.savingstrategy.OneDirectoryStrategy
All Implemented Interfaces:
Serializable

public class OneDirectoryStrategy extends SavingStrategy
A saving strategy that stores all files in a single directory.
This strategy:

Example of resulting path structure:

 docshare/                # Base directory (DirectoryRoot.DOCSHARE_DIRECTORY)
 +-- 1701766245000.pdf    # File named with timestamp
 +-- 1701766246000.jpg    # Another file
 +-- 1701766247000.doc    # Another file
 
Since:
14.0
See Also:
  • Constructor Details

    • OneDirectoryStrategy

      public OneDirectoryStrategy()
  • Method Details

    • getDirectory

      public WebResource getDirectory(BOFile file)
      Description copied from class: SavingStrategy
      Returns the name of directory where the file will be physically stored.
      Specified by:
      getDirectory in class SavingStrategy
      Parameters:
      file - the current file
      Returns:
      the name of the directory where the file will be physically stored
    • getName

      public String getName(BOFile file, WebResource directory)
      Description copied from class: SavingStrategy
      Returns the name that will be used to save the file.
      Specified by:
      getName in class SavingStrategy
      Parameters:
      file - the current file
      directory - the web resource representing the directory in which the resource will be saved
      Returns:
      the name that will be used to save the file