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

public class DateDirectoryStrategy extends SavingStrategy
A saving strategy that organizes files in a date-based directory structure.
This strategy:
  • Creates directories under DirectoryRoot.DOCSHARE_DIRECTORY with current date subdirectories (format: YYYYMMDD)
  • Generates filenames based on the current time (format: HHmmssSSS)

Example of resulting path structure:

 docshare/                # Base directory (DirectoryRoot.DOCSHARE_DIRECTORY)
 +-- 20231205/            # Subdirectory (current date)
     +-- 093045123.pdf    # File (time-based name)
     +-- 093046789.jpg    # Another file
 
Since:
14.0
See Also:
  • Constructor Details

    • DateDirectoryStrategy

      public DateDirectoryStrategy()
  • 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