public final class UtilsFileSystemCommons
extends java.lang.Object
Utility class for reading and processing files.
Project:Library for the integration with the services of @Firma, eVisor and TS@.
| Modifier and Type | Method and Description |
|---|---|
static byte[] |
getArrayByteFileBase64Encoded(java.lang.String path,
boolean isRelativePath)
Reads a file from system by given path (absolute or relative to classpath) and encodes to Base64 format.
|
static java.lang.String |
getFileBase64Encoded(byte[] content)
Method that obtains a String encoded on Base64 from the content of a file.
|
static byte[] |
readFile(java.lang.String path,
boolean isRelativePath)
Reads a file from system by given path (absolute or relative to classpath).
|
static java.lang.String |
readFileBase64Encoded(java.lang.String path,
boolean isRelativePath)
Reads a file from system by given path (absolute or relative to classpath) and encodes to Base64 format.
|
static byte[] |
readFileFromFileSystemBase64Encoded(java.lang.String filePathToRead)
Retrieves encoded Base64 file content.
|
static void |
writeFile(byte[] data,
java.lang.String filename)
Write data into a file.
|
public static byte[] readFileFromFileSystemBase64Encoded(java.lang.String filePathToRead)
filePathToRead - absolute file path.public static java.lang.String readFileBase64Encoded(java.lang.String path,
boolean isRelativePath)
path - file path.isRelativePath - true if path is relative to classpath and false if path is absolute.public static java.lang.String getFileBase64Encoded(byte[] content)
content - Parameter that represents the content of a file.public static byte[] getArrayByteFileBase64Encoded(java.lang.String path,
boolean isRelativePath)
path - file path.isRelativePath - true if path is relative to classpath and false if path is absolute.public static byte[] readFile(java.lang.String path,
boolean isRelativePath)
path - file path.isRelativePath - true if path is relative to classpath and false if path is absolute.public static void writeFile(byte[] data,
java.lang.String filename)
throws java.io.IOException
data - information to include into file.filename - name of file to record.java.io.IOException - if a error happens accessing to file.