/** * Get the value of a system environment variable. Expand any macros * (%...%) if run on windows. Generally, on Linux et. al. environment * variables are already expanded. * * @param key the environment variable name * @return the value with expanded macros if on windows. */ String getSystemEnv(String key) { return getSystemEnv(key, null); }
public static byte[] read(InputStream in) throws IOException { return copy(in, new ByteBufferOutputStream()).toByteArray(); }
@Override public void close() throws IOException { /* * Allow original buffer to be garbage collected and prevent it being * remapped for this FileResouce. */ buffer = CLOSED; if (deleteOnClose) IO.delete(file); }
public static BufferedReader reader(ByteBuffer bb, Charset encoding) { return reader(new ByteBufferInputStream(bb), encoding); }
public static Path copy(InputStream in, Path path) throws IOException { try (FileChannel out = writeChannel(path)) { copy(in, out); } return path; }
@Override public void load(Reader r) throws IOException { String source = IO.collect(new NonClosingReader(r)); load(source, null, null, null); }
@Override public SetLocation file(String file) { this.file = (file != null) ? IO.normalizePath(file) : null; return this; }
public static byte[] read(InputStream in) throws IOException { return copy(in, new ByteBufferOutputStream()).toByteArray(); }
public static BufferedReader reader(ByteBuffer bb, Charset encoding) { return reader(new ByteBufferInputStream(bb), encoding); }
public static Path copy(InputStream in, Path path) throws IOException { try (FileChannel out = writeChannel(path)) { copy(in, out); } return path; }
/** * Get the value of a system environment variable. Expand any macros * (%...%) if run on windows. Generally, on Linux et. al. environment * variables are already expanded. * * @param key the environment variable name * @return the value with expanded macros if on windows. */ String getSystemEnv(String key) { return getSystemEnv(key, null); }
public static byte[] read(InputStream in) throws IOException { return copy(in, new ByteBufferOutputStream()).toByteArray(); }
public static BufferedReader reader(ByteBuffer bb, Charset encoding) { return reader(new ByteBufferInputStream(bb), encoding); }
public static byte[] read(InputStream in) throws IOException { return copy(in, new ByteBufferOutputStream()).toByteArray(); }
public static BufferedReader reader(ByteBuffer bb, Charset encoding) { return reader(new ByteBufferInputStream(bb), encoding); }
public static byte[] read(InputStream in) throws IOException { return copy(in, new ByteBufferOutputStream()).toByteArray(); }
public static BufferedReader reader(ByteBuffer bb, Charset encoding) { return reader(new ByteBufferInputStream(bb), encoding); }
public static byte[] read(InputStream in) throws IOException { return copy(in, new ByteBufferOutputStream()).toByteArray(); }
public static byte[] read(InputStream in) throws IOException { return copy(in, new ByteBufferOutputStream()).toByteArray(); }