private Stream<ArchiveFileSet> streamArchives() { final List<ArchiveFileSet> l = new LinkedList<>(); for (final Resource r : zips) { l.add(configureArchive(new ZipFileSet(), r)); } for (final Resource r : tars) { l.add(configureArchive(new TarFileSet(), r)); } return l.stream(); }
/** * File to incorporate as application.xml. * @param descr the descriptor file */ public void setAppxml(File descr) { deploymentDescriptor = descr; if (!deploymentDescriptor.exists()) { throw new BuildException( "Deployment descriptor: %s does not exist.", deploymentDescriptor); } // Create a ZipFileSet for this file, and pass it up. ZipFileSet fs = new ZipFileSet(); fs.setFile(deploymentDescriptor); fs.setFullpath(XML_DESCRIPTOR_PATH); super.addFileset(fs); }
/** * set the deployment descriptor to use (WEB-INF/web.xml); * required unless <tt>update=true</tt> * @param descr the deployment descriptor file */ public void setWebxml(File descr) { deploymentDescriptor = descr; if (!deploymentDescriptor.exists()) { throw new BuildException("Deployment descriptor: does not exist.", deploymentDescriptor); } // Create a ZipFileSet for this file, and pass it up. ZipFileSet fs = new ZipFileSet(); fs.setFile(deploymentDescriptor); fs.setFullpath(XML_DESCRIPTOR_PATH); super.addFileset(fs); }
/** Process groupfilesets */ private void processGroupFilesets() { // Add the files found in groupfileset to fileset for (FileSet fs : groupfilesets) { logWhenWriting("Processing groupfileset ", Project.MSG_VERBOSE); final FileScanner scanner = fs.getDirectoryScanner(getProject()); final File basedir = scanner.getBasedir(); for (String file : scanner.getIncludedFiles()) { logWhenWriting("Adding file " + file + " to fileset", Project.MSG_VERBOSE); final ZipFileSet zf = new ZipFileSet(); zf.setProject(getProject()); zf.setSrc(new File(basedir, file)); add(zf); filesetsFromGroupfilesets.add(zf); } } }
File classesJar = new File(destDir, "WEB-INF/lib/classes.jar"); ZipFileSet zfs = new ZipFileSet(); zfs.setProject(prj); zfs.setSrc(archive);
/** * A ZipFileset accepts another ZipFileSet or a FileSet as reference * FileSets are often used by the war task for the lib attribute * @param p the project to use * @return the abstract fileset instance */ @Override protected AbstractFileSet getRef(Project p) { dieOnCircularReference(p); Object o = getRefid().getReferencedObject(p); if (o instanceof ZipFileSet) { return (AbstractFileSet) o; } if (o instanceof FileSet) { ZipFileSet zfs = new ZipFileSet((FileSet) o); configureFileSet(zfs); return zfs; } String msg = getRefid().getRefId() + " doesn\'t denote a zipfileset or a fileset"; throw new BuildException(msg); }
@RequestMapping("/starter.zip") @ResponseBody public ResponseEntity<byte[]> springZip(BasicProjectRequest basicRequest) throws IOException { ProjectRequest request = (ProjectRequest) basicRequest; File dir = this.projectGenerator.generateProjectStructure(request); File download = this.projectGenerator.createDistributionFile(dir, ".zip"); String wrapperScript = getWrapperScript(request); new File(dir, wrapperScript).setExecutable(true); Zip zip = new Zip(); zip.setProject(new Project()); zip.setDefaultexcludes(false); ZipFileSet set = new ZipFileSet(); set.setDir(dir); set.setFileMode("755"); set.setIncludes(wrapperScript); set.setDefaultexcludes(false); zip.addFileset(set); set = new ZipFileSet(); set.setDir(dir); set.setIncludes("**,"); set.setExcludes(wrapperScript); set.setDefaultexcludes(false); zip.addFileset(set); zip.setDestFile(download.getCanonicalFile()); zip.execute(); return upload(download, dir, generateFileName(request, "zip"), "application/zip"); }
final ZipFileSet oldFiles = new ZipFileSet(); oldFiles.setProject(getProject()); oldFiles.setSrc(renamedFile);
private void processDescriptor(File xmlDtor, String xmlDtorName) { if (!xmlDtor.exists()) throw new BuildException("Deployment descriptor: " + xmlDtor + " does not exist."); // Add a new fileset for the DD. ZipFileSet fs = new ZipFileSet(); fs.setFile(xmlDtor); fs.setFullpath("META-INF/" + xmlDtorName); super.addFileset(fs); }
private void setServicexml(File [] servicexml) { this.servicexml = servicexml; for (int i = 0; i < servicexml.length; i++) { if (!servicexml[i].exists()) { throw new BuildException("Service deployment descriptor: " + servicexml[i] + " does not exist."); } } for (int i = 0; i < servicexml.length; i++) { ZipFileSet fs = new ZipFileSet(); fs.setFile(servicexml[i]); fs.setFullpath(servicexml[i].getName()); super.addFileset(fs); } // look for oc-service.xml extension dd if (extXmlStr != null) { File extXml = (metainfbase == null) ? new File(extXmlStr) : new File(metainfbase, extXmlStr); if (!extXml.exists()) { throw new BuildException("Service extension deployment descriptor: " + extXml + " does not exist."); } ZipFileSet fs = new ZipFileSet(); fs.setFile(extXml); fs.setFullpath("META-INF/oc-service.xml"); super.addFileset(fs); } }
ZipFileSet fs = new ZipFileSet(); fs.setFile(componentFile); fs.setFullpath(componentFile.getName()); ZipFileSet fs = new ZipFileSet(); fs.setFile(deployableunitxml); fs.setFullpath("META-INF/deployable-unit.xml");
ZipFileSet zipFileSet = new ZipFileSet(); zipFileSet.setSrc(classpathFileList[i]); zipFileSet.setIncludes(urlPath);
ZipFileSet fileSet = new ZipFileSet(); fileSet.setDir(fileToZip); fileSet.setPrefix(fileToZip.getPath());
rezip.setDestFile(outputFile); rezip.setProject(new Project()); ZipFileSet z = new ZipFileSet(); z.setSrc(war); rezip.addZipfileset(z); throw new UnsupportedOperationException(hpi.getFile()+" is a directory and not packaged yet. this isn't supported"); z = new ZipFileSet(); z.setFile(hpi.getFile()); z.setFullpath("/WEB-INF/plugins/"+hpi.getArtifactId()+".hpi");
File classesJar = new File(destDir, "WEB-INF/lib/classes.jar"); ZipFileSet zfs = new ZipFileSet(); zfs.setProject(prj); zfs.setSrc(archive);
ZipFileSet zip = new ZipFileSet(); zip.setProject(getProject()); zip.setSrc(lib);
task.init(); task.setDestFile(new File(zipFilePath)); ZipFileSet zipFileSet = new ZipFileSet(); zipFileSet.setPrefix("WEB-INF/lib"); zipFileSet.setDir(new File(libsToAddDir));
private void updateSourceWar(File jspCompileDir) { // Finally need to merge the compiled jsps in War warTask = new War(); warTask.setProject(getProject()); warTask.setDestFile(war); warTask.setUpdate(true); ZipFileSet jspFiles = new ZipFileSet(); // The JSPs will be in the a well known location. The // app name from server.xml and the war file name will // be // in the path, the war name minus the .war extension // (if present) will also be used. jspFiles.setDir(jspCompileDir); warTask.addClasses(jspFiles); warTask.setTaskName(getTaskName()); warTask.execute(); }
Zip zip = new Zip(); zip.setDestFile(dest); ZipFileSet fs = new ZipFileSet(); fs.setDir(source); fs.setPrefix(serverName);