public final class FileUtil extends Object
| Modifier and Type | Method and Description |
|---|---|
static boolean |
updateFile(Path path,
byte[] newdata)
Update a file with the given binary content if neeed.
|
static void |
updateFile(Path from,
Path to)
Read the content of the input file and update the target accordingly
|
static boolean |
updateFile(Path path,
String newdata)
Update a file with the given string content if neeed.
|
static boolean |
updateFile(Path path,
String newdata,
Charset encoding)
Update a file with the given string content if neeed.
|
public static boolean updateFile(Path path, String newdata) throws IOException
path - the path of the file to updatenewdata - the new string data, null to delete the filetrue if the file was modified, false otherwiseIOException - if an exception occurspublic static boolean updateFile(Path path, String newdata, Charset encoding) throws IOException
path - the path of the file to updatenewdata - the new string data, null to delete the fileencoding - the encoding to usetrue if the file was modified, false otherwiseIOException - if an exception occurspublic static boolean updateFile(Path path, byte[] newdata) throws IOException
path - the path of the file to updatenewdata - the new binary data, null to delete the filetrue if the file was modified, false otherwiseIOException - if an exception occurspublic static void updateFile(Path from, Path to) throws IOException
from - the source fileto - the target fileIOException - if an exception occursApache Camel