Package net.datacrow.util.zip

Examples of net.datacrow.util.zip.ZipFile.addEntry()


          // adds the module jar file to the distribution
          if (module.isCustomModule() && module.getXmlModule() != null) {
              XmlModule xmlModule = module.getXmlModule();
            String jarName = xmlModule.getJarFilename();
            byte[] content = Utilities.readFile(new File(DataCrow.moduleDir, jarName));
            zf.addEntry(jarName, content);
          }

          // settings export
          File file = module.getSettings().getSettings().getSettingsFile();
          module.getSettings().save();
View Full Code Here


          // settings export
          File file = module.getSettings().getSettings().getSettingsFile();
          module.getSettings().save();
          if (file.exists()) {
              byte[] content = Utilities.readFile(file);
              zf.addEntry(file.getName(), content);
          }
         
          // reports
          if (module.hasReports()) {
              String reportDir = DataCrow.reportDir + module.getName().toLowerCase().replaceAll("[/\\*%., ]", "");
View Full Code Here

             
                Directory dir = new Directory(reportDir, true, new String[] {"xsl, xslt"});
              for (String filename : dir.read()) {
                  byte[] content = Utilities.readFile(new File(filename));
                  String name = filename.substring(filename.indexOf(File.separator + "reports" + File.separator) + 9);
                        zf.addEntry(name, content);
              }
          }
         
          // item export
          if (!module.isChildModule() &&
View Full Code Here

                 
                  // get the XML
                  file = new File(parent.getPath(), module.getTableName() + ".xml");
                  if (file.exists() && !canceled) {
                      byte[] data = Utilities.readFile(file);
                      zf.addEntry(module.getTableName() + ".xml", data);
                     
                      // get the images
                      File imgPath = new File(parent.getPath(), module.getTableName() + "_images");
                      if (imgPath.exists()) {
                          for (String image : imgPath.list()) {
View Full Code Here

                              if (canceled) break;
                             
                              // add the image
                              File imgFile = new File(imgPath.toString(), image);
                              byte[] img = Utilities.readFile(imgFile);
                              zf.addEntry(module.getTableName() + "_" + image, img);
                              imgFile.delete();
                          }
                          imgPath.delete();
                      }
                      new File(parent.getPath(), module.getTableName() + ".xsd").delete();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.