Package edu.berkeley.cs.jqf.fuzz.util
Class IOUtils
java.lang.Object
edu.berkeley.cs.jqf.fuzz.util.IOUtils
Utility class containing static methods for common I/O operations
- Author:
- Rohan Padhye
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic FilecreateDirectory(File newDir) Creates a new writable directory.static FilecreateDirectory(File parent, String name) Creates a new writable directory in a given parent directory.static File[]Resolves an input file or a directory of files.
-
Constructor Details
-
IOUtils
public IOUtils()
-
-
Method Details
-
resolveInputFileOrDirectory
Resolves an input file or a directory of files. This is useful for operations like providing seed inputs to a fuzzing engine or repro'ing a corpus of test inputs.- Parameters:
file- a file or directory- Returns:
- a listing of files, if `file` is a directory; a list containing only `file`, if it is a regular file; `null` if `file` is also `null`
- Throws:
FileNotFoundException- iffiledoes not exist
-
createDirectory
Creates a new writable directory in a given parent directory.- Parameters:
parent- the parent directoryname- the name of the new directory to create- Returns:
- the newly created directory
- Throws:
IOException- if a writable directory was not created
-
createDirectory
Creates a new writable directory.- Parameters:
newDir- the new directory to create- Returns:
- the newly created directory (same as `newDir`)
- Throws:
IOException- if a writable directory was not created
-