public class EZFileUtils extends Object
Constructor and Description |
---|
EZFileUtils() |
Modifier and Type | Method and Description |
---|---|
static void |
copyFile(File source,
File target)
Binary copy of a file from source to target.
|
static boolean |
deleteDirectory(File dir)
Utilitary method to delete the directory given as parameter
|
static boolean |
deleteDirectory(String dir_path)
Utilitary method to delete the directory corresponding to the given path
|
static void |
deleteFile(String path)
Utility method to delete a file from one location
|
static File |
forceFileExtension(File f,
String ext)
Forces a file name to terminate with a particular file extension.
|
static String |
getFileContent(File file)
Returns the content of a file as text.
|
static String |
getFileName(File path)
Returns the file name (without extension) given a absolute path.
|
static String |
gunzipFile(String gzFile)
Uncompress a gzipped file.
|
static boolean |
gunzipFile(String gzFile,
String ungzFile)
Uncompress a gzipped file.
|
static String |
terminatePath(String path)
Check whether or not a path terminates with a separator.
|
static String |
terminateURL(String url)
Check whether or not a path terminates with a separator.
|
public static String terminatePath(String path)
public static String terminateURL(String url)
public static void deleteFile(String path) throws IOException
IOException
public static boolean deleteDirectory(String dir_path)
dir_path
- - the directory pathpublic static boolean deleteDirectory(File dir)
dir
- - the directory to deletepublic static void copyFile(File source, File target) throws IOException
IOException
public static String getFileContent(File file) throws IOException
IOException
public static String getFileName(File path)
public static File forceFileExtension(File f, String ext)
f
- the file to checkext
- the file extension (do not provide the prefix dot).public static String gunzipFile(String gzFile)
gzFile
- the gzipped filePlealog Software - 2003-2017