public final class Files extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
Files.Content
Wrap of file content
|
| Constructor and Description |
|---|
Files() |
| Modifier and Type | Method and Description |
|---|---|
static File |
getJarPath()
Return jar file path
|
static Files.Content |
read(File file)
Try to read a file as string or read as hex if the data is binary
|
static byte[] |
readBinary(File file) |
static Object |
readObject(File file) |
static String |
readText(File file)
Try to read a file as string
|
static String |
readText(File file,
Charset cs) |
static void |
writeBinary(File file,
byte[] bytes) |
static void |
writeObject(Object object,
File file) |
public static File getJarPath()
public static Object readObject(File file) throws IOException, ClassNotFoundException
file - IOExceptionClassNotFoundExceptionpublic static void writeObject(Object object, File file) throws IOException
object - file - IOExceptionpublic static Files.Content read(File file) throws IOException
file - IOExceptionpublic static byte[] readBinary(File file) throws IOException
file - IOExceptionpublic static void writeBinary(File file, byte[] bytes) throws IOException
file - IOExceptionpublic static String readText(File file) throws IOException
file - IOExceptionpublic static String readText(File file, Charset cs) throws IOException
file - cs - IOExceptionCopyright © 2025 Eclipse Paho. All rights reserved.