Add support for checking for assets when opening android app

This commit is contained in:
drdev
2014-05-03 01:40:06 +00:00
parent 1729ce8a02
commit 4fd2df0093
2 changed files with 46 additions and 1 deletions

View File

@@ -80,6 +80,16 @@ public final class FileUtil {
FileUtil.writeFile(new File(filename), data);
}
public static void writeFile(File file, String text) {
try {
PrintWriter p = new PrintWriter(file);
p.print(text);
p.close();
} catch (final Exception ex) {
throw new RuntimeException("FileUtil : writeFile() error, problem writing file - " + file + " : " + ex);
}
}
// writes each element of ArrayList on a separate line
// this is used to write a file of Strings
// this will create a new file if needed
@@ -109,7 +119,7 @@ public final class FileUtil {
public static String readFileToString(String filename) {
return TextUtil.join(readFile(filename), "\n");
}
public static List<String> readFile(final String filename) {
return FileUtil.readFile(new File(filename));
}