Package org.locationtech.jts.jump.util
Class FileUtil
- java.lang.Object
-
- org.locationtech.jts.jump.util.FileUtil
-
public class FileUtil extends Object
File-related utility functions.
-
-
Constructor Summary
Constructors Constructor Description FileUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static ListgetContents(InputStream inputStream)static ListgetContents(String textFileName)Reads a text file.static voidsetContents(String textFileName, String contents)Saves the String to a file with the given filename.static voidsetContents(String textFileName, List lines)Saves the List of Strings to a file with the given filename.static voidzip(Collection files, File zipFile)
-
-
-
Method Detail
-
getContents
public static List getContents(String textFileName) throws FileNotFoundException, IOException
Reads a text file.- Parameters:
textFileName- the pathname of the file to open- Returns:
- the lines of the text file
- Throws:
FileNotFoundException- if the text file is not foundIOException- if the file is not found or another I/O error occurs
-
setContents
public static void setContents(String textFileName, String contents) throws IOException
Saves the String to a file with the given filename.- Parameters:
textFileName- the pathname of the file to create (or overwrite)contents- the data to save- Throws:
IOException- if an I/O error occurs.
-
getContents
public static List getContents(InputStream inputStream) throws IOException
- Throws:
IOException
-
setContents
public static void setContents(String textFileName, List lines) throws IOException
Saves the List of Strings to a file with the given filename.- Parameters:
textFileName- the pathname of the file to create (or overwrite)lines- the Strings to save as lines in the file- Throws:
IOException- if an I/O error occurs.
-
zip
public static void zip(Collection files, File zipFile) throws IOException
- Throws:
IOException
-
-