com.webstersmalley.picweb.offline.deploy
Class FTPDeployer

java.lang.Object
  extended by com.webstersmalley.picweb.offline.deploy.FTPDeployer
All Implemented Interfaces:
Deployer

public class FTPDeployer
extends java.lang.Object
implements Deployer

Implements an FTP deployer.

Author:
Matthew Smalley

Field Summary
private  org.apache.commons.net.ftp.FTPClient ftp
           
private  java.lang.String hostname
           
private static org.apache.commons.logging.Log log
          Logger for the class.
private  java.lang.String password
           
private  int port
           
private  java.lang.String remoteDir
           
private  java.lang.String username
           
 
Constructor Summary
FTPDeployer(java.lang.String hostname, int port, java.lang.String remoteDir, java.lang.String username, java.lang.String password)
           
 
Method Summary
private  void deleteAll()
           
private  void deleteDir(java.lang.String remotePath)
           
 void deploy(java.lang.String baseDir)
          Deploy a directory to a remote repository, such as FTP.
 void deploy(java.lang.String baseDir, boolean clean)
          Deploy a directory to a remote repository, such as FTP.
static void main(java.lang.String[] args)
           
private  void makeDirs(java.lang.String remotePath)
           
private  void storeFile(java.io.File f, java.lang.String remotePath)
           
private  void storeFolder(java.lang.String folder, java.lang.String remotePath)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

private static org.apache.commons.logging.Log log
Logger for the class.


ftp

private org.apache.commons.net.ftp.FTPClient ftp

hostname

private java.lang.String hostname

port

private int port

remoteDir

private java.lang.String remoteDir

username

private java.lang.String username

password

private java.lang.String password
Constructor Detail

FTPDeployer

public FTPDeployer(java.lang.String hostname,
                   int port,
                   java.lang.String remoteDir,
                   java.lang.String username,
                   java.lang.String password)
Method Detail

deploy

public void deploy(java.lang.String baseDir)
            throws java.io.IOException
Description copied from interface: Deployer
Deploy a directory to a remote repository, such as FTP. Append contents to those already existing.

Specified by:
deploy in interface Deployer
Parameters:
baseDir - the directory to deploy
Throws:
java.io.IOException

deploy

public void deploy(java.lang.String baseDir,
                   boolean clean)
            throws java.io.IOException
Description copied from interface: Deployer
Deploy a directory to a remote repository, such as FTP. Optionally clean the repository before deploying.

Specified by:
deploy in interface Deployer
Parameters:
baseDir - the directory to deploy.
clean - if true, the repository will be cleaned first.
Throws:
java.io.IOException

storeFolder

private void storeFolder(java.lang.String folder,
                         java.lang.String remotePath)
                  throws java.io.IOException
Throws:
java.io.IOException

storeFile

private void storeFile(java.io.File f,
                       java.lang.String remotePath)
                throws java.io.IOException
Throws:
java.io.IOException

makeDirs

private void makeDirs(java.lang.String remotePath)
               throws java.io.IOException
Throws:
java.io.IOException

deleteDir

private void deleteDir(java.lang.String remotePath)
                throws java.io.IOException
Throws:
java.io.IOException

deleteAll

private void deleteAll()
                throws java.io.IOException
Throws:
java.io.IOException

main

public static void main(java.lang.String[] args)


Copyright © 2004-2005-2005 Webster Smalley. All Rights Reserved.