Package uk.ac.diamond.daq.scanning
Class FilePathService
java.lang.Object
uk.ac.diamond.daq.scanning.FilePathService
- All Implemented Interfaces:
IFilePathService
Implementation of the
IFilePathService which determines the next path to write to.-
Constructor Summary
Constructors -
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
-
Constructor Details
-
FilePathService
public FilePathService()
-
-
Method Details
-
getNextPath
Description copied from interface:IFilePathServiceDetermine and return the next file path to write to. The file will be in the default output directory.- Specified by:
getNextPathin interfaceIFilePathService- Parameters:
template- for instance the sample name, may be null or empty string if no template is required.- Returns:
- next file path
- Throws:
IOExceptionInvalidPathException
-
getNextPath
Description copied from interface:IFilePathServiceDetermine and return the next file path to write to within the given output directory.- Specified by:
getNextPathin interfaceIFilePathService- 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:
IOExceptionInvalidPathException
-
createFolderForLinkedFiles
Description copied from interface:IFilePathServiceCreates 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.- Specified by:
createFolderForLinkedFilesin interfaceIFilePathService- Parameters:
filename- the name of the file- Returns:
- path of new folder
- Throws:
Exception- if the folder cannot be created for any reason
-
getMostRecentPath
Description copied from interface:IFilePathServiceReturns 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()- Specified by:
getMostRecentPathin interfaceIFilePathService- Returns:
- last file path
-
getVisitDir
Description copied from interface:IFilePathServiceReturns the full path to the visit directory- Specified by:
getVisitDirin interfaceIFilePathService- Returns:
- full path to the visit directory
-
getTempDir
Description copied from interface:IFilePathServiceReturns 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.- Specified by:
getTempDirin interfaceIFilePathService- Returns:
- location of temp directory for the current visit
-
getProcessedFilesDir
Description copied from interface:IFilePathServiceReturns the location of the directory in which to place processed files. TODO: remove this method and just use a subpath of /tmp- Specified by:
getProcessedFilesDirin interfaceIFilePathService- Returns:
- processed files
-
getProcessingDir
Description copied from interface:IFilePathServiceReturns the location of the directory where processing file live.- Specified by:
getProcessingDirin interfaceIFilePathService- Returns:
- location of directory containing processing files
-
getPersistenceDir
Description copied from interface:IFilePathServiceReturns the location of persistence directory. This is the location of a global read/write directory where persistent files can be stored.- Specified by:
getPersistenceDirin interfaceIFilePathService- Returns:
- location of persistence directory.
-
getProcessingTemplatesDir
Description copied from interface:IFilePathServiceReturns the location of the directory containing templates for cluster processing.- Specified by:
getProcessingTemplatesDirin interfaceIFilePathService- Returns:
- location of the processing templates directory
-
getScanNumber
- Specified by:
getScanNumberin interfaceIFilePathService- Returns:
- the current scan number. Same as NumTracker.getCurrentFileNumber() in GDA8.
- Throws:
Exception
-
getVisit
- Specified by:
getVisitin interfaceIFilePathService- Returns:
- the current visit number LocalProperties.get(LocalProperties.GDA_DEF_VISIT, LocalProperties.DEFAULT_VISIT)
- Throws:
Exception
-
getVisitConfigDir
Description copied from interface:IFilePathServiceReturns 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.- Specified by:
getVisitConfigDirin interfaceIFilePathService- Returns:
- location of the configuration directory for the current visit
-