public class FileHelper
extends java.lang.Object
File
objects.Modifier and Type | Method and Description |
---|---|
static void |
copyFile(java.io.File srcFile,
java.io.File destFile)
Copy file.
|
static org.xml.sax.InputSource |
createInputSource(java.io.File file) |
static boolean |
deleteDirectory(java.io.File directory)
Recursively deletes the given directory
|
static void |
deleteDirectory(java.io.File directory,
boolean failOnError)
Recursively deletes the given directory
|
static java.util.List |
readLines(java.io.File theFile)
Get a list of Strings from a given file.
|
public static void deleteDirectory(java.io.File directory, boolean failOnError)
directory
- The directory to deletefailOnError
- If an exception should be thrown in case the deletion did not work.public static boolean deleteDirectory(java.io.File directory)
directory
- The directory to deletetrue
if the deletion was successfully.public static org.xml.sax.InputSource createInputSource(java.io.File file) throws java.net.MalformedURLException
java.net.MalformedURLException
public static void copyFile(java.io.File srcFile, java.io.File destFile) throws java.io.IOException
srcFile
- the src filedestFile
- the dest filejava.io.IOException
public static java.util.List readLines(java.io.File theFile) throws java.io.IOException
theFile
- the file to be readjava.io.IOException
Copyright © 2002-2020. All Rights Reserved.