Exemple #1
0
 public static String readCatch(final File file) {
   try {
     return DiscUtil.read(file);
   } catch (final IOException e) {
     return null;
   }
 }
Exemple #2
0
 public static boolean writeCatch(final File file, final String content) {
   try {
     DiscUtil.write(file, content);
     return true;
   } catch (final Exception e) {
     return false;
   }
 }
Exemple #3
0
 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();
 }
Exemple #4
0
 public static boolean downloadUrl(final String urlstring, final String filename) {
   return DiscUtil.downloadUrl(urlstring, new File(filename));
 }
Exemple #5
0
 public static String read(final File file) throws IOException {
   return DiscUtil.utf8(DiscUtil.readBytes(file));
 }
Exemple #6
0
 public static void write(final File file, final String content) throws IOException {
   DiscUtil.writeBytes(file, DiscUtil.utf8(content));
 }