本文整理了Java中org.jclouds.scriptbuilder.domain.Statements.interpret()
方法的一些代码示例,展示了Statements.interpret()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Statements.interpret()
方法的具体详情如下:
包路径:org.jclouds.scriptbuilder.domain.Statements
类名称:Statements
方法名:interpret
[英]statement can have multiple newlines, note you should use lf to be portable
[中]语句可以有多个换行符,请注意,为了便于携带,您应该使用lf
代码示例来源:origin: jclouds/legacy-jclouds
/**
* interprets and adds a newline to the statement
*/
public static Statement exec(String portableStatement) {
return interpret(portableStatement + "{lf}");
}
代码示例来源:origin: com.amysta.jclouds/jclouds-scriptbuilder
/**
* interprets and adds a newline to the statement
*/
public static Statement exec(String portableStatement) {
return interpret(portableStatement + "{lf}");
}
代码示例来源:origin: jclouds/legacy-jclouds
/**
*
*
* @param method
* http method: ex GET
* @param endpoint
* uri corresponding to the request
* @param headers
* request headers to send
*/
public PipeHttpResponseToBash(String method, URI endpoint, Multimap<String, String> headers) {
super(Statements.interpret("bash"), method, endpoint, headers);
}
代码示例来源:origin: io.cloudsoft.jclouds/jclouds-scriptbuilder
/**
* interprets and adds a newline to the statement
*/
public static Statement exec(String portableStatement) {
return interpret(portableStatement + "{lf}");
}
代码示例来源:origin: org.jclouds/jclouds-scriptbuilder
/**
* interprets and adds a newline to the statement
*/
public static Statement exec(String portableStatement) {
return interpret(portableStatement + "{lf}");
}
代码示例来源:origin: org.apache.jclouds/jclouds-scriptbuilder
/**
* interprets and adds a newline to the statement
*/
public static Statement exec(String portableStatement) {
return interpret(portableStatement + "{lf}");
}
代码示例来源:origin: org.apache.jclouds/jclouds-scriptbuilder
/**
*
*
* @param method
* http method: ex GET
* @param endpoint
* uri corresponding to the request
* @param headers
* request headers to send
*/
public PipeHttpResponseToBash(String method, URI endpoint, Multimap<String, String> headers) {
super(Statements.interpret("bash"), method, endpoint, headers);
}
代码示例来源:origin: apache/jclouds
/**
* interprets and adds a newline to the statement
*/
public static Statement exec(String portableStatement) {
return interpret(portableStatement + "{lf}");
}
代码示例来源:origin: com.amysta.jclouds/jclouds-scriptbuilder
/**
*
*
* @param method
* http method: ex GET
* @param endpoint
* uri corresponding to the request
* @param headers
* request headers to send
*/
public PipeHttpResponseToBash(String method, URI endpoint, Multimap<String, String> headers) {
super(Statements.interpret("bash"), method, endpoint, headers);
}
代码示例来源:origin: io.brooklyn/brooklyn-locations-jclouds
public static Statement addAuthorizedKeysToRoot(String publicKey) {
return newStatementList(
appendFile("/root/.ssh/authorized_keys", Splitter.on('\n').split(publicKey)),
interpret("chmod 600 /root/.ssh/authorized_keys"));
}
代码示例来源:origin: jclouds/legacy-jclouds
@Override
public String render(OsFamily family) {
if (family == OsFamily.UNIX) {
return interpret(hereFile()).render(family);
} else {
return interpret(appendToWindowsFile()).render(family);
}
}
代码示例来源:origin: org.apache.jclouds/jclouds-scriptbuilder
@Override
public String render(OsFamily family) {
if (family == OsFamily.UNIX) {
return interpret(hereFile()).render(family);
} else {
return interpret(appendToWindowsFile()).render(family);
}
}
代码示例来源:origin: com.amysta.jclouds/jclouds-scriptbuilder
@Override
public String render(OsFamily family) {
if (family == OsFamily.UNIX) {
return interpret(hereFile()).render(family);
} else {
return interpret(appendToWindowsFile()).render(family);
}
}
代码示例来源:origin: org.jclouds/jclouds-scriptbuilder
@Override
public String render(OsFamily family) {
if (family == OsFamily.UNIX) {
return interpret(hereFile()).render(family);
} else {
return interpret(appendToWindowsFile()).render(family);
}
}
代码示例来源:origin: io.cloudsoft.jclouds/jclouds-scriptbuilder
@Override
public String render(OsFamily family) {
if (family == OsFamily.UNIX) {
return interpret(hereFile()).render(family);
} else {
return interpret(appendToWindowsFile()).render(family);
}
}
代码示例来源:origin: apache/jclouds
@Override
public String render(OsFamily family) {
if (family == OsFamily.UNIX) {
return interpret(hereFile()).render(family);
} else {
return interpret(appendToWindowsFile()).render(family);
}
}
代码示例来源:origin: jclouds/legacy-jclouds
@Test
public void testSwitchOn() {
ScriptBuilder builder = new ScriptBuilder();
builder.addStatement(switchArg(1,
ImmutableMap.of("start", interpret("echo started{lf}"), "stop", interpret("echo stopped{lf}"))));
assertEquals(builder.statements, ImmutableList.of(new SwitchArg(1, ImmutableMap.of("start",
interpret("echo started{lf}"), "stop", interpret("echo stopped{lf}")))));
}
代码示例来源:origin: jclouds/legacy-jclouds
public void testSwitchArgWindows() {
assertEquals(
new SwitchArg(1, ImmutableMap.of("0", interpret("echo hello zero{lf}"), "1",
interpret("echo hello one{lf}"))).render(OsFamily.WINDOWS),
"if not \"%1\" == \"0\" if not \"%1\" == \"1\" (\r\n set EXCEPTION=bad argument: %1 not in 0 1\r\n goto abort\r\n)\r\ngoto CASE_%1\r\n:CASE_0\r\n echo hello zero\r\n GOTO END_SWITCH\r\n:CASE_1\r\n echo hello one\r\n GOTO END_SWITCH\r\n:END_SWITCH\r\n");
}
}
代码示例来源:origin: apache/jclouds
public void testSwitchArgWindows() {
assertEquals(
new SwitchArg(1, ImmutableMap.of("0", interpret("echo hello zero{lf}"), "1",
interpret("echo hello one{lf}"))).render(OsFamily.WINDOWS),
"if not \"%1\" == \"0\" if not \"%1\" == \"1\" (\r\n set EXCEPTION=bad argument: %1 not in 0 1\r\n goto abort\r\n)\r\ngoto CASE_%1\r\n:CASE_0\r\n echo hello zero\r\n GOTO END_SWITCH\r\n:CASE_1\r\n echo hello one\r\n GOTO END_SWITCH\r\n:END_SWITCH\r\n");
}
}
代码示例来源:origin: apache/jclouds
@Test
public void testSwitchOn() {
ScriptBuilder builder = new ScriptBuilder();
builder.addStatement(switchArg(1,
ImmutableMap.of("start", interpret("echo started{lf}"), "stop", interpret("echo stopped{lf}"))));
assertEquals(builder.statements, ImmutableList.of(new SwitchArg(1, ImmutableMap.of("start",
interpret("echo started{lf}"), "stop", interpret("echo stopped{lf}")))));
}
内容来源于网络,如有侵权,请联系作者删除!