@Override public Proc launch(ProcStarter starter) throws IOException { EnvVars e = new EnvVars(env); if (starter.envs!=null) { for (String env : starter.envs) { e.addLine(env); } } starter.envs = Util.mapToEnv(e); return outer.launch(starter); }
public synchronized EnvVars getEnvironmentVariables() { if(envVars !=null) return envVars; envVars = new EnvVars(); try { byte[] environ = readFileToByteArray(getFile("environ")); int pos=0; for (int i = 0; i < environ.length; i++) { byte b = environ[i]; if(b==0) { envVars.addLine(new String(environ,pos,i-pos)); pos=i+1; } } } catch (IOException e) { // failed to read. this can happen under normal circumstances (most notably permission denied) // so don't report this as an error. } return envVars; } }
envVars.addLine(readLine(fd, addr, "env["+ n +"]"));
envVars.addLine(m.readString()); } catch (IOException e) {
envVars.addLine(readLine(fd, addr, "env["+ n +"]"));
public synchronized EnvVars getEnvironmentVariables() { if (envVars != null) { return envVars; } envVars = new EnvVars(); try { byte[] environ = FileUtils.readFileToByteArray(getFile("environ")); int pos = 0; for (int i = 0; i < environ.length; i++) { byte b = environ[i]; if (b == 0) { envVars.addLine(new String(environ, pos, i - pos)); pos = i + 1; } } } catch (IOException e) { // failed to read. this can happen under normal circumstances (most notably permission denied) // so don't report this as an error. } return envVars; } }
public synchronized EnvVars getEnvironmentVariables() { if(envVars !=null) return envVars; envVars = new EnvVars(); try { byte[] environ = FileUtils.readFileToByteArray(getFile("environ")); int pos=0; for (int i = 0; i < environ.length; i++) { byte b = environ[i]; if(b==0) { envVars.addLine(new String(environ,pos,i-pos)); pos=i+1; } } } catch (IOException e) { // failed to read. this can happen under normal circumstances (most notably permission denied) // so don't report this as an error. } return envVars; } }
public synchronized EnvVars getEnvironmentVariables() { if(envVars !=null) return envVars; envVars = new EnvVars(); try { byte[] environ = FileUtils.readFileToByteArray(getFile("environ")); int pos=0; for (int i = 0; i < environ.length; i++) { byte b = environ[i]; if(b==0) { envVars.addLine(new String(environ,pos,i-pos)); pos=i+1; } } } catch (IOException e) { // failed to read. this can happen under normal circumstances (most notably permission denied) // so don't report this as an error. } return envVars; } }
public synchronized EnvVars getEnvironmentVariables() { if(envVars !=null) return envVars; envVars = new EnvVars(); try { byte[] environ = FileUtils.readFileToByteArray(getFile("environ")); int pos=0; for (int i = 0; i < environ.length; i++) { byte b = environ[i]; if(b==0) { envVars.addLine(new String(environ,pos,i-pos)); pos=i+1; } } } catch (IOException e) { // failed to read. this can happen under normal circumstances (most notably permission denied) // so don't report this as an error. } return envVars; } }
public synchronized EnvVars getEnvironmentVariables() { if(envVars !=null) return envVars; envVars = new EnvVars(); try { RandomAccessFile as = new RandomAccessFile(getFile("as"),"r"); if(LOGGER.isLoggable(FINER)) LOGGER.finer("Reading "+getFile("as")); try { for( int n=0; ; n++ ) { // read a pointer to one entry as.seek(to64(envp+n*4)); int p = adjust(as.readInt()); if(p==0) break; // completed the walk // now read the null-terminated string envVars.addLine(readLine(as, p, "env["+ n +"]")); } } finally { as.close(); } } catch (IOException e) { // failed to read. this can happen under normal circumstances (most notably permission denied) // so don't report this as an error. } return envVars; }
private String getExecutable() throws IOException, InterruptedException { EnvVars env = new EnvVars(); for (String pair : envHost) { env.addLine(pair); } return DockerTool.getExecutable(toolName, node, getListener(), env); } };
@Override public Proc launch(ProcStarter starter) throws IOException { EnvVars e = new EnvVars(env); if (starter.envs!=null) { for (String env : starter.envs) { e.addLine(env); } } starter.envs = Util.mapToEnv(e); return outer.launch(starter); }
public synchronized EnvVars getEnvironmentVariables() { if(envVars !=null) return envVars; envVars = new EnvVars(); try { RandomAccessFile as = new RandomAccessFile(getFile("as"),"r"); if(LOGGER.isLoggable(FINER)) LOGGER.finer("Reading "+getFile("as")); try { for( int n=0; ; n++ ) { // read a pointer to one entry as.seek(to64(envp+n*4)); int p = adjust(as.readInt()); if(p==0) break; // completed the walk // now read the null-terminated string envVars.addLine(readLine(as, p, "env["+ n +"]")); } } finally { as.close(); } } catch (IOException e) { // failed to read. this can happen under normal circumstances (most notably permission denied) // so don't report this as an error. } return envVars; }
public synchronized EnvVars getEnvironmentVariables() { if(envVars !=null) return envVars; envVars = new EnvVars(); try { RandomAccessFile as = new RandomAccessFile(getFile("as"),"r"); if(logger.isTraceEnabled()) logger.debug("Reading "+getFile("as")); try { for( int n=0; ; n++ ) { // read a pointer to one entry as.seek(to64(envp+n*4)); int p = adjust(as.readInt()); if(p==0) break; // completed the walk // now read the null-terminated string envVars.addLine(readLine(as, p, "env["+ n +"]")); } } finally { as.close(); } } catch (IOException e) { // failed to read. this can happen under normal circumstances (most notably permission denied) // so don't report this as an error. } return envVars; }
public synchronized EnvVars getEnvironmentVariables() { if (envVars != null) { return envVars; } envVars = new EnvVars(); try { RandomAccessFile as = new RandomAccessFile(getFile("as"), "r"); if (logger.isTraceEnabled()) { logger.debug("Reading " + getFile("as")); } try { for (int n = 0;; n++) { // read a pointer to one entry as.seek(to64(envp + n * 4)); int p = adjust(as.readInt()); if (p == 0) { break; // completed the walk } // now read the null-terminated string envVars.addLine(readLine(as, p, "env[" + n + "]")); } } finally { as.close(); } } catch (IOException e) { // failed to read. this can happen under normal circumstances (most notably permission denied) // so don't report this as an error. } return envVars; }
public synchronized EnvVars getEnvironmentVariables() { if(envVars !=null) return envVars; envVars = new EnvVars(); try { byte[] environ = readFileToByteArray(getFile("environ")); int pos=0; for (int i = 0; i < environ.length; i++) { byte b = environ[i]; if(b==0) { envVars.addLine(new String(environ,pos,i-pos)); pos=i+1; } } } catch (IOException e) { // failed to read. this can happen under normal circumstances (most notably permission denied) // so don't report this as an error. } return envVars; } }
public EnvVars getEnv(String container, Launcher launcher) throws IOException, InterruptedException { final ArgumentListBuilder args = dockerCommand() .add("exec") .add("--tty") .add(container) .add("env"); final ByteArrayOutputStream out = new ByteArrayOutputStream(); int status = launcher.launch() .envs(getEnvVars()) .cmds(args) .stdout(out).quiet(!verbose).stderr(listener.getLogger()).join(); if (status != 0) { throw new RuntimeException("Failed to retrieve container's environment"); } EnvVars env = new EnvVars(); LineIterator it = new LineIterator(new StringReader(out.toString())); while (it.hasNext()) { env.addLine(it.nextLine()); } return env; }
envVars.addLine(readLine(fd, addr, "env["+ n +"]"));
envVars.addLine(m.readString()); } catch (IOException e) {
envVars.addLine(m.readString()); } catch (IOException e) {