Package picard.nio
Class PicardIOUtils
java.lang.Object
picard.nio.PicardIOUtils
Ported from GATKIOUtils.java
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic File
createTempFile
(String name, String extension) Creates a temp file that will be deleted on exit This will also mark the corresponding Tribble/Tabix/BAM indices matching the temp file for deletion.static File
createTempFileInDirectory
(String name, String extension, File targetDir) Creates a temp file in a target directory that will be deleted on exit This will also mark the corresponding Tribble/Tabix/BAM indices matching the temp file for deletion.static void
deleteOnExit
(Path fileToDelete) Schedule a file or directory to be deleted on JVM shutdown.static void
deleteRecursively
(Path rootPath) Delete rootPath recursively
-
Constructor Details
-
PicardIOUtils
public PicardIOUtils()
-
-
Method Details
-
deleteOnExit
Schedule a file or directory to be deleted on JVM shutdown. This callsdeleteRecursively(Path)
onfileToDelete
as a shutdown hook.- Parameters:
fileToDelete
- file or directory to be deleted recursively at JVM shutdown.
-
createTempFile
Creates a temp file that will be deleted on exit This will also mark the corresponding Tribble/Tabix/BAM indices matching the temp file for deletion.- Parameters:
name
- Prefix of the file;File.createTempFile(String, String, File)
requires that this be >= 3 charactersextension
- Extension to concat to the end of the file.- Returns:
- A file in the temporary directory starting with name, ending with extension, which will be deleted after the program exits.
-
createTempFileInDirectory
Creates a temp file in a target directory that will be deleted on exit This will also mark the corresponding Tribble/Tabix/BAM indices matching the temp file for deletion.- Parameters:
name
- Prefix of the file;File.createTempFile(String, String, File)
requires that this be >= 3 charactersextension
- Extension to concat to the end of the file name e.g. ".txt"targetDir
- Directory in which to create the temp file. If null, the default temp directory is used.- Returns:
- A file in the temporary directory starting with name, ending with extension, which will be deleted after the program exits. TODO: consolidate this and BucketUtils::getTempFilePath
-
deleteRecursively
Delete rootPath recursively- Parameters:
rootPath
- is the file/directory to be deleted
-