| | |
| | |
|
| | | public static File writeToFile(String fileName, byte[] fileBytes) {
|
| | | try {
|
| | | writeToFile(fileName, fileBytes, 0, fileBytes.length);
|
| | | return writeToFile(fileName, fileBytes, 0, fileBytes.length);
|
| | | }catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | |
| | | return null;
|
| | | }
|
| | |
|
| | | public static File getFile(String shortFileName) {
|
| | | String dir = MainActivity.getInstance().getFilesDir().getAbsolutePath();
|
| | | return new File(dir, shortFileName);
|
| | | }
|
| | |
|
| | |
|
| | | public static byte[] readFile(File file) {
|
| | | // Open file
|
| | |
| | | }
|
| | |
|
| | |
|
| | | public static void deleteFile(String fileName) {
|
| | | try {
|
| | | String dir = MainActivity.getInstance().getFilesDir().getAbsolutePath();
|
| | |
|
| | | File file = new File(dir, fileName);
|
| | | if (file.exists()) {
|
| | | file.delete();
|
| | | }
|
| | | }catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | | }
|