Package org.eclipse.scanning.api.scan
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 Summary
Modifier and TypeMethodDescriptioncreateFolderForLinkedFiles(String filename) 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.Returns the name of the path returned by the most recent call to.invalid reference
#getNextPath()getNextPath(String template) Determine and return the next file path to write to.getNextPath(String dir, String template) Determine and return the next file path to write to within the given output directory.Returns the location of persistence directory.Returns the location of the directory in which to place processed files.Returns the location of the directory where processing file live.Returns the location of the directory containing templates for cluster processing.intReturns the location of the directory to use for temporary files for the current visit.getVisit()Returns the location of the directory to use for files such configuration files of any type, saved scan files, etc.Returns the full path to the visit directory
-
Method Details
-
getNextPath
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
Determine and return the next file path to write to within the given output directory.- Parameters:
dir- directory to create the file intemplate- 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
- Returns:
- the current scan number. Same as NumTracker.getCurrentFileNumber() in GDA8.
- Throws:
Exception
-
getVisit
- Returns:
- the current visit number LocalProperties.get(LocalProperties.GDA_DEF_VISIT, LocalProperties.DEFAULT_VISIT)
- Throws:
Exception
-
createFolderForLinkedFiles
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
Returns the name of the path returned by the most recent call to. Note that this is not guaranteed to be the file for the current scan.invalid reference
#getNextPath()- Returns:
- last file path
- Throws:
IllegalStateException- ifhas never been calledinvalid reference
#getNextPath()
-
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 thetmpsubdirectory 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 thexmlsubdirectory 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
-