Esempio n. 1
0
 public static String getContentURL(String URL) throws IOException {
   File file = new File(Database.convertURLToFileName(URL));
   String content = "";
   if (file.exists() && !file.isDirectory()) {
     content = new String(Files.readAllBytes(file.toPath()));
   }
   return content;
 }
Esempio n. 2
0
 public static void saveURL(String URL, InputStream stream) throws IOException {
   File file = new File(Database.convertURLToFileName(URL));
   Path targetPath = file.toPath();
   file.mkdirs();
   if (file.exists()) {
     Files.copy(stream, targetPath, StandardCopyOption.REPLACE_EXISTING);
   }
 }