Class ScpHelper

java.lang.Object
org.apache.maven.wagon.providers.ssh.ScpHelper

public class ScpHelper extends Object
Scp helper for general algorithms on ssh server. See putDirectory(...) for more info on bulk directory upload.
  • Field Details

  • Constructor Details

    • ScpHelper

      public ScpHelper(org.apache.maven.wagon.CommandExecutor executor)
  • Method Details

    • getResourceDirectory

      public static String getResourceDirectory(String resourceName)
    • getResourceFilename

      public static String getResourceFilename(String r)
    • getResource

      public static org.apache.maven.wagon.resource.Resource getResource(String resourceName)
    • getPrivateKey

      public static File getPrivateKey(org.apache.maven.wagon.authentication.AuthenticationInfo authenticationInfo) throws FileNotFoundException
      Throws:
      FileNotFoundException
    • createZip

      public static void createZip(List<String> files, File zipName, File basedir) throws IOException
      Throws:
      IOException
    • getPath

      protected static String getPath(String basedir, String dir)
    • putDirectory

      public void putDirectory(org.apache.maven.wagon.Wagon wagon, File sourceDirectory, String destinationDirectory) throws org.apache.maven.wagon.TransferFailedException, org.apache.maven.wagon.ResourceDoesNotExistException, org.apache.maven.wagon.authorization.AuthorizationException
      Put a whole directory content, by transferring a unique zip file and uncompressing it on the target ssh server with unzip command.
      Throws:
      org.apache.maven.wagon.TransferFailedException
      org.apache.maven.wagon.ResourceDoesNotExistException
      org.apache.maven.wagon.authorization.AuthorizationException
    • getFileList

      public List<String> getFileList(String destinationDirectory, org.apache.maven.wagon.repository.Repository repository) throws org.apache.maven.wagon.TransferFailedException, org.apache.maven.wagon.ResourceDoesNotExistException, org.apache.maven.wagon.authorization.AuthorizationException
      Throws:
      org.apache.maven.wagon.TransferFailedException
      org.apache.maven.wagon.ResourceDoesNotExistException
      org.apache.maven.wagon.authorization.AuthorizationException
    • resourceExists

      public boolean resourceExists(String resourceName, org.apache.maven.wagon.repository.Repository repository) throws org.apache.maven.wagon.TransferFailedException, org.apache.maven.wagon.authorization.AuthorizationException
      Throws:
      org.apache.maven.wagon.TransferFailedException
      org.apache.maven.wagon.authorization.AuthorizationException
    • createRemoteDirectories

      public void createRemoteDirectories(String path, org.apache.maven.wagon.repository.RepositoryPermissions permissions) throws org.apache.maven.wagon.CommandExecutionException
      Throws:
      org.apache.maven.wagon.CommandExecutionException