Beispiel #1
0
 public File createOutputFile(File f)
     throws IOException, BadExtensionException, FileNotEditableException {
   if (!docChecker.accept(f)) {
     throw new BadExtensionException(
         String.format("The filename %s is not acceptable for Excell Files", f.getName()));
   }
   if (!f.exists() || f.delete()) {
     File ret = new File(f.getAbsolutePath());
     File parFold = ret.getParentFile();
     if (parFold != null && !parFold.exists()) parFold.mkdirs();
     ret.createNewFile();
     return ret;
   } else {
     throw new FileNotEditableException(String.format("The file %s can not be edit", f.getName()));
   }
 }
Beispiel #2
0
 public void write(File f, WordDocument w) throws Docx4JException {
   if (docChecker.accept(f)) {
     w.getWmlPackage().save(f);
   } else {
   }
 }