/** * Set this entry's user id. * * @param userId This entry's new user id. */ public void setUserId(int userId) { setUserId((long) userId); }
/** * Convenience method to set this entry's group and user ids. * * @param userId This entry's new user id. * @param groupId This entry's new group id. */ public void setIds(int userId, int groupId) { setUserId(userId); setGroupId(groupId); }
break; case "uid": currEntry.setUserId(Long.parseLong(val)); break; case "uname":
protected int putFileContent(Launcher launcher, String containerId, String path, String filename, byte[] content, Integer mode) throws IOException, InterruptedException { TarEntry entry = new TarEntry(filename); entry.setUserId(0); entry.setGroupId(0); entry.setSize(content.length); if (mode != null) { entry.setMode(mode); } ByteArrayOutputStream out = new ByteArrayOutputStream(); TarOutputStream tar = new TarOutputStream(out); tar.putNextEntry(entry); tar.write(content); tar.closeEntry(); tar.close(); ArgumentListBuilder args = new ArgumentListBuilder() .add("cp", "-", containerId + ":" + path); return launchDockerCLI(launcher, args) .stdin(new ByteArrayInputStream(out.toByteArray())) .stderr(launcher.getListener().getLogger()).join(); }
protected int putFileContent(Launcher launcher, String containerId, String path, String filename, byte[] content, Integer mode) throws IOException, InterruptedException { TarEntry entry = new TarEntry(filename); entry.setUserId(0); entry.setGroupId(0); entry.setSize(content.length); if (mode != null) { entry.setMode(mode); } ByteArrayOutputStream out = new ByteArrayOutputStream(); TarOutputStream tar = new TarOutputStream(out); tar.putNextEntry(entry); tar.write(content); tar.closeEntry(); tar.close(); ArgumentListBuilder args = new ArgumentListBuilder() .add("cp", "-", containerId + ":" + path); return launchDockerCLI(launcher, args) .stdin(new ByteArrayInputStream(out.toByteArray())) .stderr(launcher.getListener().getLogger()).join(); }