/** * Returns the list of commands used to extract the contents of the archive with the given name. * <p> * Optionally, Java archives of type * * @see #extractCommands(String, String) */ public static List<String> extractCommands(String fileName, String sourceDir, String targetDir, boolean extractJar) { return extractCommands(fileName, sourceDir, targetDir, extractJar, true); }
public static void deploy(Map<String, ?> props, String archiveUrl, SshMachineLocation machine, String tmpDir, String destDir, String destFile) { deploy(null, props, archiveUrl, machine, destDir, true, tmpDir, destFile); }
@Test(groups="Integration") public void testDeployExplicitDestFile() throws Exception { String destFile = "custom-destFile.jar"; ArchiveUtils.deploy(origJar.getAbsolutePath(), machine, destDir.getAbsolutePath(), destFile); assertFilesEqual(new File(destDir, destFile), origJar); }
/** See {@link #addDirContentsAt(File, String)} and {@link #addAtRoot(File)}. */ public ArchiveBuilder addDirContentsAtRoot(File dir) { return addDirContentsAt(dir, ""); }
/** * Adds the given file or directory to the root of the archive, preserving its name. * To add the contents of a directory without the dir name, use {@link #addDirContentsAtRoot(File)}. * See also {@link #addAt(File, String)}. */ public ArchiveBuilder addAtRoot(File file) { return addAt(file, ""); }
/** as {@link #deploy(ResourceUtils, Map, String, SshMachineLocation, String, String, String)} with the most common parameters */ public static TaskFactory<?> deploy(final ResourceUtils optionalResolver, final String archiveUrl, final SshMachineLocation machine, final String destDir) { return deploy(optionalResolver, null, archiveUrl, machine, destDir, false, null, null); }
/** * Installs a URL onto a remote machine. * * @see #install(SshMachineLocation, String, String) * @see SshMachineLocation#installTo(Map, String, String) */ public static int install(Map<String, ?> props, SshMachineLocation machine, String urlToInstall, String target, int numAttempts) { return install(null, props, machine, urlToInstall, target, numAttempts); }
/** @deprecated since 0.7.0 use {@link #addFromLocalBaseDir(File, String)}, or * one of the other add methods if adding relative to baseDir was not intended */ @Deprecated public ArchiveBuilder add(String baseDir, String fileSubPath) { return addFromLocalBaseDir(baseDir, fileSubPath); }
/** * Create an {@link ArchiveBuilder} for a {@link ArchiveType#ZIP Zip} format archive. */ public static ArchiveBuilder zip() { return new ArchiveBuilder(ArchiveType.ZIP); }
public static void deploy(Map<String, ?> props, String archiveUrl, SshMachineLocation machine, String destDir, String destFile) { deploy(props, archiveUrl, machine, destDir, destDir, destFile); } public static void deploy(Map<String, ?> props, String archiveUrl, SshMachineLocation machine, String tmpDir, String destDir, String destFile) {
@Test(groups="Integration") public void testDeployJarNotUnpacked() throws Exception { ArchiveUtils.deploy(origJar.getAbsolutePath(), machine, destDir.getAbsolutePath()); assertFilesEqual(new File(destDir, origJar.getName()), origJar); }
/** * As {@link #addDirContentsAt(File, String)}, * using {@literal .} as the parent directory name for the contents. * * @deprecated since 0.7.0 use {@link #addDirContentsAt(File, String) * to clarify API, argument types, and be explicit about where it should be installed, * because JARs seem to require <code>""<code> whereas ZIPs might want <code>"./"</code>. */ @Deprecated public ArchiveBuilder addDir(File dir) { return addDirContentsAt(dir, "."); }
/** * Returns the list of commands used to extract the contents of the archive with the given name. * <p> * The archive will be extracted in its current directory unless it is a Java archive of type {@code .jar}, * {@code .war} or {@code .ear}, which will be left as is. * * @see #extractCommands(String, String, String, boolean) */ public static List<String> extractCommands(String fileName, String sourceDir) { return extractCommands(fileName, sourceDir, ".", false); }
/** * Installs a URL onto a remote machine. * * @see #install(Map, SshMachineLocation, String, String, int) */ public static int install(SshMachineLocation machine, String urlToInstall, String target) { return install(MutableMap.<String, Object>of(), machine, urlToInstall, target, NUM_RETRIES_FOR_COPYING); }
/** * Create an {@link ArchiveBuilder} for a {@link ArchiveType#JAR Jar} format archive. */ public static ArchiveBuilder jar() { return new ArchiveBuilder(ArchiveType.JAR); }
/** * Deploys an archive file to a remote machine and extracts the contents. */ public static void deploy(String archiveUrl, SshMachineLocation machine, String destDir) { deploy(MutableMap.<String, Object>of(), archiveUrl, machine, destDir); }
/** * Create an {@link ArchiveBuilder} for an archive with the given name. */ public static ArchiveBuilder archive(String archive) { return new ArchiveBuilder(archive); }