public class FileUtils
extends java.lang.Object
| Constructor and Description |
|---|
FileUtils() |
| Modifier and Type | Method and Description |
|---|---|
static java.lang.String |
getFileName(java.lang.String fullPath) |
static byte[] |
readFileAsByteArray(java.lang.String path)
This method reads file as binary data.
|
static java.lang.String |
readFileAsString(java.lang.String path)
This method reads the file as String.
|
static java.lang.String |
readFileAsString(java.lang.String path,
java.lang.String charsetName)
This method reads the file as String and assumes that file contains information in specified encoding.
|
public static java.lang.String readFileAsString(java.lang.String path,
java.lang.String charsetName)
throws java.io.IOException
path - String that contains the path to the file to be readcharsetName - String that contains the encoding namejava.io.IOException - if any problem occurredpublic static java.lang.String readFileAsString(java.lang.String path)
throws java.io.IOException
path - String that contains the path to the file to be readjava.io.IOException - if any problem occurredpublic static byte[] readFileAsByteArray(java.lang.String path)
throws java.io.IOException
path - String that contains the path to the file to be readjava.io.IOException - if any problem occurredpublic static java.lang.String getFileName(java.lang.String fullPath)