org.jclouds.scriptbuilder.domain.Statements.extractTargzIntoDirectory()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(9.3k)|赞(0)|评价(0)|浏览(102)

本文整理了Java中org.jclouds.scriptbuilder.domain.Statements.extractTargzIntoDirectory()方法的一些代码示例,展示了Statements.extractTargzIntoDirectory()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Statements.extractTargzIntoDirectory()方法的具体详情如下:
包路径:org.jclouds.scriptbuilder.domain.Statements
类名称:Statements
方法名:extractTargzIntoDirectory

Statements.extractTargzIntoDirectory介绍

[英]untar, ungzip the data received from the request parameters.
[中]untar,解压缩从请求参数接收的数据。

代码示例

代码示例来源:origin: com.amysta.jclouds/jclouds-scriptbuilder

public static Statement extractTargzIntoDirectory(URI targz, String directory) {
 return extractTargzIntoDirectory("GET", targz, ImmutableMultimap.<String, String> of(), directory);
}

代码示例来源:origin: jclouds/legacy-jclouds

public static Statement extractTargzIntoDirectory(URI targz, String directory) {
 return extractTargzIntoDirectory("GET", targz, ImmutableMultimap.<String, String> of(), directory);
}

代码示例来源:origin: apache/jclouds

public static Statement extractTargzIntoDirectory(URI targz, String directory) {
 return extractTargzIntoDirectory("GET", targz, ImmutableMultimap.<String, String> of(), directory);
}

代码示例来源:origin: org.jclouds/jclouds-scriptbuilder

public static Statement extractTargzIntoDirectory(URI targz, String directory) {
 return extractTargzIntoDirectory("GET", targz, ImmutableMultimap.<String, String> of(), directory);
}

代码示例来源:origin: org.apache.jclouds/jclouds-scriptbuilder

public static Statement extractTargzIntoDirectory(URI targz, String directory) {
 return extractTargzIntoDirectory("GET", targz, ImmutableMultimap.<String, String> of(), directory);
}

代码示例来源:origin: io.cloudsoft.jclouds/jclouds-scriptbuilder

public static Statement extractTargzIntoDirectory(URI targz, String directory) {
 return extractTargzIntoDirectory("GET", targz, ImmutableMultimap.<String, String> of(), directory);
}

代码示例来源:origin: jclouds/legacy-jclouds

/**
* like {@link #extractTargzIntoDirectory(URI, String)} except that it
* flattens the first directory in the archive
* 
* For example, {@code apache-maven-3.0.4-bin.tar.gz} normally extracts
* directories like {@code ./apache-maven-3.0.4/bin}. This command eliminates
* the intermediate directory, in the example {@code ./apache-maven-3.0.4/}
* 
* @param tgz remote ref to download
* @param dest path where the files in the intermediate directory will end
*/
public static Statement extractTargzAndFlattenIntoDirectory(URI tgz, String dest) {
 return new StatementList(ImmutableSet.<Statement> builder()
    .add(exec("mkdir /tmp/$$"))
    .add(extractTargzIntoDirectory(tgz, "/tmp/$$"))
    .add(exec("mkdir -p " + dest))
    .add(exec("mv /tmp/$$/*/* " + dest))
    .add(exec("rm -rf /tmp/$$")).build());
}

代码示例来源:origin: io.cloudsoft.jclouds/jclouds-scriptbuilder

/**
* like {@link #extractTargzIntoDirectory(URI, String)} except that it
* flattens the first directory in the archive
* 
* For example, {@code apache-maven-3.0.4-bin.tar.gz} normally extracts
* directories like {@code ./apache-maven-3.0.4/bin}. This command eliminates
* the intermediate directory, in the example {@code ./apache-maven-3.0.4/}
* 
* @param tgz remote ref to download
* @param dest path where the files in the intermediate directory will end
*/
public static Statement extractTargzAndFlattenIntoDirectory(URI tgz, String dest) {
 return new StatementList(ImmutableSet.<Statement> builder()
    .add(exec("mkdir /tmp/$$"))
    .add(extractTargzIntoDirectory(tgz, "/tmp/$$"))
    .add(exec("mkdir -p " + dest))
    .add(exec("mv /tmp/$$/*/* " + dest))
    .add(exec("rm -rf /tmp/$$")).build());
}

代码示例来源:origin: org.jclouds/jclouds-scriptbuilder

/**
* like {@link #extractTargzIntoDirectory(URI, String)} except that it
* flattens the first directory in the archive
* 
* For example, {@code apache-maven-3.0.4-bin.tar.gz} normally extracts
* directories like {@code ./apache-maven-3.0.4/bin}. This command eliminates
* the intermediate directory, in the example {@code ./apache-maven-3.0.4/}
* 
* @param tgz remote ref to download
* @param dest path where the files in the intermediate directory will end
*/
public static Statement extractTargzAndFlattenIntoDirectory(URI tgz, String dest) {
 return new StatementList(ImmutableSet.<Statement> builder()
    .add(exec("mkdir /tmp/$$"))
    .add(extractTargzIntoDirectory(tgz, "/tmp/$$"))
    .add(exec("mkdir -p " + dest))
    .add(exec("mv /tmp/$$/*/* " + dest))
    .add(exec("rm -rf /tmp/$$")).build());
}

代码示例来源:origin: com.amysta.jclouds/jclouds-scriptbuilder

/**
* like {@link #extractTargzIntoDirectory(URI, String)} except that it
* flattens the first directory in the archive
* 
* For example, {@code apache-maven-3.0.4-bin.tar.gz} normally extracts
* directories like {@code ./apache-maven-3.0.4/bin}. This command eliminates
* the intermediate directory, in the example {@code ./apache-maven-3.0.4/}
* 
* @param tgz remote ref to download
* @param dest path where the files in the intermediate directory will end
*/
public static Statement extractTargzAndFlattenIntoDirectory(URI tgz, String dest) {
 return new StatementList(ImmutableSet.<Statement> builder()
    .add(exec("export TAR_TEMP=\"$(mktemp -d)\""))
    .add(extractTargzIntoDirectory(tgz, "\"${TAR_TEMP}\""))
    .add(exec("mkdir -p " + dest))
    .add(exec("mv \"${TAR_TEMP}\"/*/* " + dest))
    .add(exec("rm -rf \"${TAR_TEMP}\""))
    .build());
}

代码示例来源:origin: org.apache.jclouds/jclouds-scriptbuilder

/**
* like {@link #extractTargzIntoDirectory(URI, String)} except that it
* flattens the first directory in the archive
* 
* For example, {@code apache-maven-3.0.4-bin.tar.gz} normally extracts
* directories like {@code ./apache-maven-3.0.4/bin}. This command eliminates
* the intermediate directory, in the example {@code ./apache-maven-3.0.4/}
* 
* @param tgz remote ref to download
* @param dest path where the files in the intermediate directory will end
*/
public static Statement extractTargzAndFlattenIntoDirectory(URI tgz, String dest) {
 return new StatementList(ImmutableSet.<Statement> builder()
    .add(exec("export TAR_TEMP=\"$(mktemp -d)\""))
    .add(extractTargzIntoDirectory(tgz, "\"${TAR_TEMP}\""))
    .add(exec("mkdir -p " + dest))
    .add(exec("mv \"${TAR_TEMP}\"/*/* " + dest))
    .add(exec("rm -rf \"${TAR_TEMP}\""))
    .build());
}

代码示例来源:origin: apache/jclouds

/**
* like {@link #extractTargzIntoDirectory(URI, String)} except that it
* flattens the first directory in the archive
* 
* For example, {@code apache-maven-3.0.4-bin.tar.gz} normally extracts
* directories like {@code ./apache-maven-3.0.4/bin}. This command eliminates
* the intermediate directory, in the example {@code ./apache-maven-3.0.4/}
* 
* @param tgz remote ref to download
* @param dest path where the files in the intermediate directory will end
*/
public static Statement extractTargzAndFlattenIntoDirectory(URI tgz, String dest) {
 return new StatementList(ImmutableSet.<Statement> builder()
    .add(exec("export TAR_TEMP=\"$(mktemp -d)\""))
    .add(extractTargzIntoDirectory(tgz, "\"${TAR_TEMP}\""))
    .add(exec("mkdir -p " + dest))
    .add(exec("mv \"${TAR_TEMP}\"/*/* " + dest))
    .add(exec("rm -rf \"${TAR_TEMP}\""))
    .build());
}

代码示例来源:origin: jclouds/legacy-jclouds

public void testExtractTargzIntoDirectoryUNIX() {
 Statement save = Statements
    .extractTargzIntoDirectory(
       URI.create("https://s3.amazonaws.com/MinecraftDownload/launcher/minecraft_server.tar.gz"),
       "/opt/minecraft");
 assertEquals(
    save.render(OsFamily.UNIX),
    "curl -q -s -S -L --connect-timeout 10 --max-time 600 --retry 20 -X GET  https://s3.amazonaws.com/MinecraftDownload/launcher/minecraft_server.tar.gz |(mkdir -p /opt/minecraft &&cd /opt/minecraft &&tar -xpzf -)\n");
}

代码示例来源:origin: apache/jclouds

public void testExtractTargzIntoDirectoryUNIX() {
 Statement save = Statements
    .extractTargzIntoDirectory(
       URI.create("https://s3.amazonaws.com/MinecraftDownload/launcher/minecraft_server.tar.gz"),
       "/opt/minecraft");
 assertEquals(
    save.render(OsFamily.UNIX),
    "curl -q -s -S -L --connect-timeout 10 --max-time 600 --retry 20 -X GET  https://s3.amazonaws.com/MinecraftDownload/launcher/minecraft_server.tar.gz |(mkdir -p /opt/minecraft &&cd /opt/minecraft &&tar -xpzf -)\n");
}

代码示例来源:origin: org.apache.jclouds/jclouds-compute

/**
* build a shell script that invokes the contents of the http request in bash.
*
* @return a shell script that will invoke the http request
*/
public static Statement extractTargzIntoDirectory(HttpRequest targz, String directory) {
 return Statements
      .extractTargzIntoDirectory(targz.getMethod(), targz.getEndpoint(), targz.getHeaders(), directory);
}

代码示例来源:origin: jclouds/legacy-jclouds

/**
* build a shell script that invokes the contents of the http request in bash.
* 
* @return a shell script that will invoke the http request
*/
public static Statement extractTargzIntoDirectory(HttpRequest targz, String directory) {
 return Statements
      .extractTargzIntoDirectory(targz.getMethod(), targz.getEndpoint(), targz.getHeaders(), directory);
}

代码示例来源:origin: io.cloudsoft.jclouds/jclouds-compute

/**
* build a shell script that invokes the contents of the http request in bash.
* 
* @return a shell script that will invoke the http request
*/
public static Statement extractTargzIntoDirectory(HttpRequest targz, String directory) {
 return Statements
      .extractTargzIntoDirectory(targz.getMethod(), targz.getEndpoint(), targz.getHeaders(), directory);
}

代码示例来源:origin: apache/jclouds

/**
* build a shell script that invokes the contents of the http request in bash.
*
* @return a shell script that will invoke the http request
*/
public static Statement extractTargzIntoDirectory(HttpRequest targz, String directory) {
 return Statements
      .extractTargzIntoDirectory(targz.getMethod(), targz.getEndpoint(), targz.getHeaders(), directory);
}

相关文章