/** * @return the group name string. */ public String getGroup() { if (isReference()) { return ((TarFileSet) getCheckedRef()).getGroup(); } return groupName; }
/** * @return the user name for the tar entry */ public String getUserName() { if (isReference()) { return ((TarFileSet) getCheckedRef()).getUserName(); } return userName; }
/** * A TarFileset accepts another TarFileSet 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 TarFileSet) { return (AbstractFileSet) o; } if (o instanceof FileSet) { TarFileSet zfs = new TarFileSet((FileSet) o); configureFileSet(zfs); return zfs; } String msg = getRefid().getRefId() + " doesn\'t denote a tarfileset or a fileset"; throw new BuildException(msg); }
/** * @return the uid for the tar entry */ public int getUid() { if (isReference()) { return ((TarFileSet) getCheckedRef()).getUid(); } return uid; }
/** * @return the group identifier. */ public int getGid() { if (isReference()) { return ((TarFileSet) getCheckedRef()).getGid(); } return gid; }
org.apache.tools.ant.types.TarFileSet tr = (org.apache.tools.ant.types.TarFileSet) rc; return new ResourceCollectionFlags(tr.getPrefix(getProject()), tr.getFullpath(getProject()), tr.hasFileModeBeenSet() ? tr.getFileMode(getProject()) : -1, tr.hasDirModeBeenSet() ? tr.getDirMode(getProject()) : -1, tr.hasUserIdBeenSet() ? tr.getUid() : EntryHelper.UNKNOWN_ID, tr.hasGroupIdBeenSet() ? tr.getGid() : EntryHelper.UNKNOWN_ID, tr.hasUserNameBeenSet() ? tr.getUserName() : null, tr.hasGroupBeenSet() ? tr.getGroup() : null); } else { ArchiveFileSet ar = (ArchiveFileSet) rc;
final org.apache.tools.ant.types.TarFileSet t = (org.apache.tools.ant.types.TarFileSet) archiveFileSet; if (t.hasUserNameBeenSet()) { tfs.setUserName(t.getUserName()); if (t.hasGroupBeenSet()) { tfs.setGroup(t.getGroup()); if (t.hasUserIdBeenSet()) { tfs.setUid(t.getUid()); if (t.hasGroupIdBeenSet()) { tfs.setGid(t.getGid());
tar.setLongfile(fileMode); tar.setDestFile(dest); TarFileSet rc = new TarFileSet(); rc.setDir(source); rc.setPrefix(serverName); rc.setProject(project); rc.setExcludes("bin/"); tar.add(rc); rc = new TarFileSet(); rc.setDir(source); rc.setPrefix(serverName); rc.setProject(project); rc.setIncludes("bin/"); rc.setExcludes("bin/*.bat"); rc.setFileMode("755"); tar.add(rc); rc = new TarFileSet(); rc.setDir(source); rc.setPrefix(serverName); rc.setProject(project); rc.setIncludes("bin/*.bat"); tar.add(rc);
username = tarFileSet.getUserName(); group = tarFileSet.getGroup(); if (fileset instanceof RpmFileSet) { RpmFileSet rpmFileSet = (RpmFileSet)fileset;
@RequestMapping(path = "/starter.tgz", produces = "application/x-compress") @ResponseBody public ResponseEntity<byte[]> springTgz(BasicProjectRequest basicRequest) throws IOException { ProjectRequest request = (ProjectRequest) basicRequest; File dir = this.projectGenerator.generateProjectStructure(request); File download = this.projectGenerator.createDistributionFile(dir, ".tar.gz"); String wrapperScript = getWrapperScript(request); new File(dir, wrapperScript).setExecutable(true); Tar zip = new Tar(); zip.setProject(new Project()); zip.setDefaultexcludes(false); TarFileSet set = zip.createTarFileSet(); set.setDir(dir); set.setFileMode("755"); set.setIncludes(wrapperScript); set.setDefaultexcludes(false); set = zip.createTarFileSet(); set.setDir(dir); set.setIncludes("**,"); set.setExcludes(wrapperScript); set.setDefaultexcludes(false); zip.setDestFile(download.getCanonicalFile()); Tar.TarCompressionMethod method = new Tar.TarCompressionMethod(); method.setValue("gzip"); zip.setCompression(method); zip.execute(); return upload(download, dir, generateFileName(request, "tar.gz"), "application/x-compress"); }
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(); }
username = tarFileSet.getUserName(); group = tarFileSet.getGroup(); if (fileset instanceof RpmFileSet) { RpmFileSet rpmFileSet = (RpmFileSet)fileset;