Package cern.accsoft.steering.jmad.util
Interface TempFileUtil
-
- All Known Implementing Classes:
TempFileUtilImpl
public interface TempFileUtil
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
cleanup(java.lang.Object object)
recursively removes the dir related to the given object.java.io.File
getOutputDir(java.lang.String relativePath)
returns a directory created from the current output-path and the given relative path.java.io.File
getOutputFile(java.lang.Object object, java.lang.String relativePath)
returns a file created from the current output-path, a sub directory for the given object and the relative path.java.io.File
getOutputFile(java.lang.String relativePath)
returns a file created from the current output-path and the given relative path.
-
-
-
Method Detail
-
getOutputFile
java.io.File getOutputFile(java.lang.String relativePath)
returns a file created from the current output-path and the given relative path. This method also ensures, that the parent directory for the file is available.- Parameters:
relativePath
- the file-path in the current output-dir- Returns:
- the File
-
getOutputDir
java.io.File getOutputDir(java.lang.String relativePath)
returns a directory created from the current output-path and the given relative path. This method ensures that the directory exists, by creating it if non existing. The main difference togetOutputFile(String)
is thatgetOutputFile(String)
creates only the parent dir of the returned file, while this methods creates the directory itself.- Parameters:
relativePath
- the file-path relativ to the current output-dir- Returns:
- the directory
-
getOutputFile
java.io.File getOutputFile(java.lang.Object object, java.lang.String relativePath)
returns a file created from the current output-path, a sub directory for the given object and the relative path. This is especially useful, if multiple threads of jmad are running and the results shall not interfere.- Parameters:
object
- the object which is used to create a subdir name.relativePath
- the relative path- Returns:
- the file
-
cleanup
void cleanup(java.lang.Object object)
recursively removes the dir related to the given object.- Parameters:
object
- the object for which to delete the dir
-
-