Interface IFilePathService

All Known Implementing Classes:
FilePathService, MockFilePathService

public interface IFilePathService
This service provides useful file paths for writing to. It has method to get the path of the next scan file.
  • Method Details

    • getNextPath

      String getNextPath(String template) throws Exception
      Determine and return the next file path to write to. The file will be in the default output directory.
      Parameters:
      template - for instance the sample name, may be null or empty string if no template is required.
      Returns:
      next file path
      Throws:
      Exception - if the next path cannot be calculated for any reason
    • getNextPath

      String getNextPath(String dir, String template) throws Exception
      Determine and return the next file path to write to within the given output directory.
      Parameters:
      dir - directory to create the file in
      template - for instance the sample name, may be null or empty string if no template is required
      Returns:
      next file path
      Throws:
      Exception - if the next path cannot be calculated for any reason
    • getScanNumber

      int getScanNumber() throws Exception
      Returns:
      the current scan number. Same as NumTracker.getCurrentFileNumber() in GDA8.
      Throws:
      Exception
    • getVisit

      String getVisit() throws Exception
      Returns:
      the current visit number LocalProperties.get(LocalProperties.GDA_DEF_VISIT, LocalProperties.DEFAULT_VISIT)
      Throws:
      Exception
    • createFolderForLinkedFiles

      String createFolderForLinkedFiles(String filename) throws Exception
      Creates and returns the path of a new folder in the same parent folder as file path with the same name as the given file, minus the file extension. This folder can be used to write linked files to for the given scan. If the filename given is a filepath, only the last segment will be used.
      Parameters:
      filename - the name of the file
      Returns:
      path of new folder
      Throws:
      Exception - if the folder cannot be created for any reason
    • getMostRecentPath

      String getMostRecentPath() throws IllegalStateException
      Returns the name of the path returned by the most recent call to
      invalid reference
      #getNextPath()
      . Note that this is not guaranteed to be the file for the current scan.
      Returns:
      last file path
      Throws:
      IllegalStateException - if
      invalid reference
      #getNextPath()
      has never been called
    • getVisitDir

      String getVisitDir()
      Returns the full path to the visit directory
      Returns:
      full path to the visit directory
    • getTempDir

      String getTempDir()
      Returns the location of the directory to use for temporary files for the current visit. In GDA this is mapped to the tmp subdirectory of the current visit directory, the contents of which are deleted every 2 days.
      Returns:
      location of temp directory for the current visit
    • getVisitConfigDir

      String getVisitConfigDir()
      Returns the location of the directory to use for files such configuration files of any type, saved scan files, etc. In GDA this is mapped to the xml subdirectory of the current visit directory, the contents of which live for the lifetime of the visit.
      Returns:
      location of the configuration directory for the current visit
    • getProcessedFilesDir

      String getProcessedFilesDir()
      Returns the location of the directory in which to place processed files. TODO: remove this method and just use a subpath of /tmp
      Returns:
      processed files
    • getProcessingDir

      String getProcessingDir()
      Returns the location of the directory where processing file live.
      Returns:
      location of directory containing processing files
    • getPersistenceDir

      String getPersistenceDir()
      Returns the location of persistence directory. This is the location of a global read/write directory where persistent files can be stored.
      Returns:
      location of persistence directory.
    • getProcessingTemplatesDir

      String getProcessingTemplatesDir()
      Returns the location of the directory containing templates for cluster processing.
      Returns:
      location of the processing templates directory