Class Files
-
- All Implemented Interfaces:
public class Files
//http://stackoverflow.com/a/10987744
-
-
Constructor Summary
Constructors Constructor Description Files()
-
Method Summary
Modifier and Type Method Description static String
getFileValue(String fileName, Context context)
static String
getPublicFileValue(String filename)
Get file content, use this method instead of getFileValue if the file is into a public directory static Array<byte>
getFileBytes(File file)
static boolean
appendFileValue(String fileName, String value, Context context)
static boolean
setFileValue(String fileName, String value, Context context)
static boolean
writeToFile(String fileName, String value, Context context, int writeOrAppendMode)
static void
deleteFile(String fileName, Context context)
-
-
Method Detail
-
getFileValue
static String getFileValue(String fileName, Context context)
- Returns:
file content if fileName exists, null if fileName doesn't exists
-
getPublicFileValue
static String getPublicFileValue(String filename)
Get file content, use this method instead of getFileValue if the file is into a public directory
- Returns:
content of file as String
-
getFileBytes
static Array<byte> getFileBytes(File file)
-
appendFileValue
static boolean appendFileValue(String fileName, String value, Context context)
-
setFileValue
static boolean setFileValue(String fileName, String value, Context context)
-
writeToFile
static boolean writeToFile(String fileName, String value, Context context, int writeOrAppendMode)
-
deleteFile
static void deleteFile(String fileName, Context context)
-
-
-
-