Class FileUtils
java.lang.Object
ffx.utilities.FileUtils
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidAppend content to a file.static StringcopyInputStreamToTmpFile(InputStream input, String prefix, String name, String suffix) Returns the file name of a temporary copy ofinputcontent.static PathrelativePathTo(File file) Constructs a relative path from the present working directory to a file.traverseFiles(File directory, int maxDepth, String filePattern) Traverse a directory to find files matching the given regex pattern.
-
Method Details
-
copyInputStreamToTmpFile
public static String copyInputStreamToTmpFile(InputStream input, String prefix, String name, String suffix) throws IOException Returns the file name of a temporary copy ofinputcontent.- Parameters:
input- The input stream contents are copied to a temporary file.prefix- Temporary file prefix.name- Temporary file name.suffix- Temporary file suffix.- Returns:
- The temporary file.
- Throws:
IOException- An IOException is thrown if a temporary file could not be created.
-
relativePathTo
-
traverseFiles
Traverse a directory to find files matching the given regex pattern.- Parameters:
directory- The directory to traverse.maxDepth- Maximum depth to traverse.filePattern- Regular expression pattern to match file names.- Returns:
- List of matching files.
-
append
-