@Immutable public final class SimpleFileIO extends Object
FileOperations class or the instance based
FileOperationManager class.| Modifier and Type | Method and Description |
|---|---|
static String |
readFileAsString(File aFile,
Charset aCharset)
Get the content of the passed file as a string using the system line
separator.
|
static String |
readFileAsString(File aFile,
String sCharset)
Deprecated.
|
static byte[] |
readFileBytes(File aFile)
Get the content of the file as a byte array.
|
static List<String> |
readFileLines(File aFile,
Charset aCharset)
Get the content of the passed file as a list of lines, whereas each line
does not contain a separator.
|
static void |
readFileLines(File aFile,
Charset aCharset,
List<String> aTargetList)
Get the content of the passed file as a list of lines, whereas each line
does not contain a separator.
|
static List<String> |
readFileLines(File aFile,
String sCharset)
Deprecated.
|
static void |
readFileLines(File aFile,
String sCharset,
List<String> aTargetList)
Deprecated.
|
static ESuccess |
writeFile(File aFile,
byte[] aContent) |
static ESuccess |
writeFile(File aFile,
byte[] aContent,
int nOffset,
int nLength) |
static ESuccess |
writeFile(File aFile,
List<String> aContent,
Charset aCharset) |
static ESuccess |
writeFile(File aFile,
List<String> aContent,
String sCharset)
Deprecated.
|
static ESuccess |
writeFile(File aFile,
String sContent,
Charset aCharset) |
static ESuccess |
writeFile(File aFile,
String sContent,
String sCharset)
Deprecated.
|
@Nullable public static byte[] readFileBytes(@Nullable File aFile)
aFile - The file to read. May be null.null if the passed file is null or if the
passed file does not exist.@Nullable @Deprecated public static String readFileAsString(@Nullable File aFile, @Nonnull String sCharset)
aFile - The file to read. May be null.sCharset - The character set to use. May not be null.null if the file does not exist, the content
otherwise.@Nullable public static String readFileAsString(@Nullable File aFile, @Nonnull Charset aCharset)
aFile - The file to read. May be null.aCharset - The character set to use. May not be null.null if the file does not exist, the content
otherwise.@Nullable @Deprecated public static List<String> readFileLines(@Nullable File aFile, @Nonnull String sCharset)
aFile - The file to read. May be null.sCharset - The character set to use. May not be null.null if the file does not exist, the content
otherwise.@Nullable public static List<String> readFileLines(@Nullable File aFile, @Nonnull Charset aCharset)
aFile - The file to read. May be null.aCharset - The character set to use. May not be null.null if the file does not exist, the content
otherwise.@Deprecated public static void readFileLines(@Nullable File aFile, @Nonnull String sCharset, @Nonnull List<String> aTargetList)
aFile - The file to read. May be null.sCharset - The character set to use. May not be null.aTargetList - The target list to be filled. May not be null.public static void readFileLines(@Nullable File aFile, @Nonnull Charset aCharset, @Nonnull List<String> aTargetList)
aFile - The file to read. May be null.aCharset - The character set to use. May not be null.aTargetList - The target list to be filled. May not be null.@Nonnull public static ESuccess writeFile(@Nonnull File aFile, @Nonnull byte[] aContent, @Nonnegative int nOffset, @Nonnegative int nLength)
@Nonnull @Deprecated public static ESuccess writeFile(@Nonnull File aFile, @Nonnull String sContent, @Nonnull String sCharset)
@Nonnull public static ESuccess writeFile(@Nonnull File aFile, @Nonnull String sContent, @Nonnull Charset aCharset)
@Nonnull @Deprecated public static ESuccess writeFile(@Nonnull File aFile, @Nonnull List<String> aContent, @Nonnull String sCharset)
Copyright © 2006–2015 phloc systems. All rights reserved.