Package ffx.utilities
Class FileUtils
java.lang.Object
ffx.utilities.FileUtils
FileUtils class.
- Since:
- 1.0
- Author:
- Michael J. Schnieders
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
copyInputStreamToTmpFile
(InputStream input, String prefix, String name, String suffix) Returns the file name of a temporary copy ofinput
content.static Path
relativePathTo
(File file) Constructs a relative path from the present working directory to a file.
-
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 ofinput
content.- 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
Constructs a relative path from the present working directory to a file.- Parameters:
file
- Construct a relative path to file.- Returns:
- Relative path to file.
-