/** * statement can have multiple newlines, note you should use {@code lf} to be * portable * * @see ShellToken */ public static Statement interpret(String... portableStatements) { return new InterpretableStatement(portableStatements); }
public String render(OsFamily family) { checkArgument(family != OsFamily.WINDOWS, "windows not supported"); return super.render(family); } }
public String render(OsFamily family) { checkArgument(family != OsFamily.WINDOWS, "windows not supported"); return super.render(family); } }
/** * statement can have multiple newlines, note you should use {@code lf} to be * portable * * @see ShellToken */ public static Statement interpret(String... portableStatements) { return new InterpretableStatement(portableStatements); }
public String render(OsFamily family) { checkArgument(family != OsFamily.WINDOWS, "windows not supported"); return super.render(family); } }
/** * statement can have multiple newlines, note you should use {@code lf} to be * portable * * @see ShellToken */ public static Statement interpret(String... portableStatements) { return new InterpretableStatement(portableStatements); }
public String render(OsFamily family) { checkArgument(family != OsFamily.WINDOWS, "windows not supported"); return super.render(family); } }
/** * statement can have multiple newlines, note you should use {@code lf} to be * portable * * @see ShellToken */ public static Statement interpret(String... portableStatements) { return new InterpretableStatement(portableStatements); }
public String render(OsFamily family) { checkArgument(family != OsFamily.WINDOWS, "windows not supported"); return super.render(family); } }
/** * statement can have multiple newlines, note you should use {@code lf} to be * portable * * @see ShellToken */ public static Statement interpret(String... portableStatements) { return new InterpretableStatement(portableStatements); }
public String render(OsFamily family) { checkArgument(family != OsFamily.WINDOWS, "windows not supported"); return super.render(family); } }
/** * statement can have multiple newlines, note you should use {@code lf} to be * portable * * @see ShellToken */ public static Statement interpret(String... portableStatements) { return new InterpretableStatement(portableStatements); }
/** * * @param toExec * what to invoke * @param method * http method: ex GET * @param endpoint * uri corresponding to the request * @param headers * request headers to send */ public PipeHttpResponseTo(Statement toExec, String method, URI endpoint, Multimap<String, String> headers) { super(String.format("%s -X %s %s %s |(%s)\n", SaveHttpResponseTo.CURL, method, Joiner.on(' ').join( Iterables.transform(headers.entries(), new Function<Entry<String, String>, String>() { @Override public String apply(Entry<String, String> from) { return String.format("-H \"%s: %s\"", from.getKey(), from.getValue()); } })), endpoint.toASCIIString(), toExec.render(OsFamily.UNIX))); }
/** executes the given statements on the server using jclouds ScriptBuilder, * wrapping in a script which is polled periodically. * the output is returned once the script completes (disadvantage compared to other methods) * but the process is nohupped and the SSH session is not kept, * so very useful for long-running processes */ public ListenableFuture<ExecResponse> submitRunScript(String ...statements) { return submitRunScript(new InterpretableStatement(statements)); } public ListenableFuture<ExecResponse> submitRunScript(Statement script) {
/** * * @param toExec * what to invoke * @param method * http method: ex GET * @param endpoint * uri corresponding to the request * @param headers * request headers to send */ public PipeHttpResponseTo(Statement toExec, String method, URI endpoint, Multimap<String, String> headers) { super(String.format("%s -X %s %s %s |(%s)\n", SaveHttpResponseTo.CURL, method, Joiner.on(' ').join( Iterables.transform(headers.entries(), new Function<Entry<String, String>, String>() { @Override public String apply(Entry<String, String> from) { return String.format("-H \"%s: %s\"", from.getKey(), from.getValue()); } })), endpoint.toASCIIString(), toExec.render(OsFamily.UNIX))); }