From 718ce32eb11b30bf6df9e177fdf4b15b157b8555 Mon Sep 17 00:00:00 2001 From: AconiteX <63141077+AconiteX@users.noreply.github.com> Date: Mon, 9 Aug 2021 14:29:35 -0400 Subject: [PATCH] Delete file_access.java --- .../game/script/developer/file_access.java | 88 ------------------- 1 file changed, 88 deletions(-) delete mode 100755 sku.0/sys.server/compiled/game/script/developer/file_access.java diff --git a/sku.0/sys.server/compiled/game/script/developer/file_access.java b/sku.0/sys.server/compiled/game/script/developer/file_access.java deleted file mode 100755 index 79c871528..000000000 --- a/sku.0/sys.server/compiled/game/script/developer/file_access.java +++ /dev/null @@ -1,88 +0,0 @@ -package script.developer; - -import script.obj_id; - -import java.io.File; -import java.io.FileInputStream; -import java.io.FileWriter; - -public class file_access extends script.base_script -{ - public file_access() - { - } - public static String readTextFile(String fileName) throws InterruptedException - { - String result = null; - File f = new File(fileName); - if (f.exists()) - { - long len = f.length(); - if (len > 0) - { - try - { - FileInputStream inputStream = new FileInputStream(f); - byte[] buf = new byte[(int)len]; - inputStream.read(buf); - result = new String(buf); - } - catch(Exception e) - { - obj_id self = getSelf(); - sendSystemMessageTestingOnly(self, "An exception occurred while trying to read " + fileName); - } - } - } - return result; - } - public static boolean isWritable(String fileName) throws InterruptedException - { - boolean result = false; - File f = new File(fileName); - if (f.exists()) - { - if (f.canWrite()) - { - result = true; - } - } - return result; - } - public static boolean writeTextFile(String fileName, String fileContents) throws InterruptedException - { - boolean result = false; - File f = new File(fileName); - if (!f.exists()) - { - try - { - f.createNewFile(); - } - catch(Exception e) - { - return false; - } - } - if (f.canWrite()) - { - f.delete(); - try - { - if (f.createNewFile()) - { - FileWriter writer = new FileWriter(f); - writer.write(fileContents); - writer.close(); - result = true; - } - } - catch(Exception e) - { - obj_id self = getSelf(); - sendSystemMessageTestingOnly(self, "failed to write " + fileName + " : " + e); - } - } - return result; - } -}