Package picard.nio

# Class PicardIOUtils

java.lang.Object
picard.nio.PicardIOUtils

public class PicardIOUtils extends Object
Ported from GATKIOUtils.java

## Constructor Summary

Constructors
Constructor
Description
`PicardIOUtils()`

## Method Summary

Modifier and Type
Method
Description
`static 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

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### PicardIOUtils

public PicardIOUtils()

## Method Details

### deleteOnExit

public static void deleteOnExit(Path fileToDelete)
Schedule a file or directory to be deleted on JVM shutdown. This calls `deleteRecursively(Path)` on `fileToDelete` as a shutdown hook.

Parameters:
  `fileToDelete` - file or directory to be deleted recursively at JVM shutdown.

### createTempFile

public static 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.

Parameters:
  `name` - Prefix of the file; `File.createTempFile(String, String, File)` requires that this be >= 3 characters
  `extension` - 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

public 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.

Parameters:
  `name` - Prefix of the file; `File.createTempFile(String, String, File)` requires that this be >= 3 characters
  `extension` - 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

public static void deleteRecursively(Path rootPath)
Delete rootPath recursively

Parameters:
  `rootPath` - is the file/directory to be deleted