public static String readCatch(final File file) { try { return DiscUtil.read(file); } catch (final IOException e) { return null; } }
public static boolean writeCatch(final File file, final String content) { try { DiscUtil.write(file, content); return true; } catch (final Exception e) { return false; } }
public static boolean deleteRecursive(final File path) throws FileNotFoundException { if (!path.exists()) throw new FileNotFoundException(path.getAbsolutePath()); boolean ret = true; if (path.isDirectory()) { for (final File f : path.listFiles()) { ret = ret && DiscUtil.deleteRecursive(f); } } return ret && path.delete(); }
public static boolean downloadUrl(final String urlstring, final String filename) { return DiscUtil.downloadUrl(urlstring, new File(filename)); }
public static String read(final File file) throws IOException { return DiscUtil.utf8(DiscUtil.readBytes(file)); }
public static void write(final File file, final String content) throws IOException { DiscUtil.writeBytes(file, DiscUtil.utf8(content)); }