public final class FileUtils extends Object
Modifier and Type | Field and Description |
---|---|
static com.google.gson.Gson |
GSON |
static long |
ONE_GB
The number of bytes in a gigabyte.
|
static long |
ONE_KB
The number of bytes in a kilobyte.
|
static long |
ONE_MB
The number of bytes in a megabyte.
|
static String |
PATH_SEPARATOR |
static byte[] |
SEPARATOR |
static String |
TEMP_FOLDER |
Constructor and Description |
---|
FileUtils() |
Modifier and Type | Method and Description |
---|---|
static void |
copyFile(String filename,
String newName)
copy the file with the provided string
|
static boolean |
deleteFile(String filename)
Delete the file with the provided string
|
static String |
encodeFilename(String text)
Encode the provided text as filename
|
static Map<String,Long> |
jsonFileToMap(String filename)
Convert a json file to map
|
static Set<String> |
jsonFileToSet(String filename)
Convert a json file to set
|
static void |
objectToJsonFile(String filename,
Object object) |
String |
unCompressFile(String filename)
(Gzip) Uncompress a compressed file
|
public static final String PATH_SEPARATOR
public static final String TEMP_FOLDER
public static final byte[] SEPARATOR
public static final com.google.gson.Gson GSON
public static final long ONE_KB
public static final long ONE_MB
public static final long ONE_GB
public static boolean deleteFile(String filename)
filename
- - the name of the file to deletepublic static void copyFile(String filename, String newName) throws IOException
filename
- - the name of the file to copyIOException
public static Set<String> jsonFileToSet(String filename) throws IOException
filename
- IOException
public static Map<String,Long> jsonFileToMap(String filename) throws IOException
filename
- IOException
public static void objectToJsonFile(String filename, Object object) throws IOException
filename
- object
- IOException
public static String encodeFilename(String text)
text
- public String unCompressFile(String filename) throws IOException
filename
- IOException
Copyright © 2016 iNetria. All rights reserved.