|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectFTPInstall
class FTPInstall
Main class which handles installation of jFTPd from command line. The command line has a fixed syntax and can be computed by automation tools that download the latest version of jFTPd and then deploy them online, overwriting the previous version (but keeping the settings). Creation date: (10/10/2001 4:01:41 PM)
Field Summary | |
---|---|
private static java.io.PrintWriter |
log
|
protected static java.lang.String |
os_name
|
Constructor Summary | |
---|---|
FTPInstall()
Default constructor. |
Method Summary | |
---|---|
static java.lang.String |
convertArrayToString(java.lang.String[] array)
Converts an array of Strings into a single String, where the elements are separated by a space. |
static void |
log(java.lang.String message)
Writes a log message into the installation log file. |
static void |
main(java.lang.String[] args)
Main install method. |
static boolean |
onAix()
Checks if the operating system is AIX. |
static boolean |
onLinux()
Checks if the operating sistem is Linux Creation date: (29-Mar-02 16:02:05) |
static boolean |
onSolaris()
Checks if the operating sistem is Solaris. |
static boolean |
onWindows()
Checks if the operating sistem is Windows Creation date: (29-Mar-02 16:09:53) |
static java.lang.String |
prepareFileName(java.lang.String fileName)
Returns the absolute path for the given filename. |
private static void |
runCommand(java.lang.String command)
Runs a system command using the Runtime interface and waits for the command to be executed. |
private static void |
runCommand(java.lang.String[] command)
Runs a system command using the Runtime interface and waits for the command to be executed. |
static boolean |
unixInstall(java.lang.String archiveName,
java.lang.String version,
java.lang.String swdistDirectory,
java.lang.String deploymentDirectory)
Installs (or updates) a jFTPd server on UNIX systems. |
static void |
unpack(java.io.File archive,
java.io.File swdistDir)
Extracts an archive in the given directory. |
static boolean |
windowsInstall(java.lang.String archiveName,
java.lang.String version,
java.lang.String swdistDirectory,
java.lang.String deploymentDirectory)
Installs (or updates) a jFTPd server on Windows systems. |
private static void |
writeFile(java.io.InputStream input,
java.io.File destination)
Dumps the content that arrive via the input stream into the specified file. |
private static void |
writeFile(java.lang.String inputName,
java.io.File destination)
Copies a file. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static java.io.PrintWriter log
protected static java.lang.String os_name
Constructor Detail |
---|
public FTPInstall()
Method Detail |
---|
public static java.lang.String convertArrayToString(java.lang.String[] array)
public static void log(java.lang.String message)
message
- the message to be written to file.public static void main(java.lang.String[] args)
args
- Arguments taken from command line:
public static boolean onAix()
public static boolean onLinux()
public static boolean onSolaris()
public static boolean onWindows()
public static java.lang.String prepareFileName(java.lang.String fileName)
private static void runCommand(java.lang.String[] command) throws java.io.IOException
java.io.IOException
- thrown when there's a failure running the command.private static void runCommand(java.lang.String command) throws java.io.IOException
java.io.IOException
- thrown when there's a failure running the command.public static boolean unixInstall(java.lang.String archiveName, java.lang.String version, java.lang.String swdistDirectory, java.lang.String deploymentDirectory) throws java.io.IOException
archiveName
- archive file name (must be a tar.gz file)version
- extracts the archive into [deploymentDirectory][jftpd-version]swdistDirectory
- directory where the archive can be unpacked (a temp dir for example)deploymentDirectory
- extracts the archive into [deploymentDirectory][jftpd-version]
java.io.IOException
- Thrown if something goes wrong with the installation.public static void unpack(java.io.File archive, java.io.File swdistDir) throws java.io.IOException
archive
- java.io.File archive to be extractedinstalldir
- java.io.File directory where to extract.
java.io.IOException
- The exception description.public static boolean windowsInstall(java.lang.String archiveName, java.lang.String version, java.lang.String swdistDirectory, java.lang.String deploymentDirectory) throws java.io.IOException
archiveName
- archive file name (must be a tar.gz file)version
- extracts the archive into [deploymentDirectory][jftpd-version]swdistDirectory
- directory where the archive can be unpacked (a temp dir for example)deploymentDirectory
- extracts the archive into [deploymentDirectory][jftpd-version]
java.io.IOException
- Thrown if something goes wrong with the installation.private static void writeFile(java.io.InputStream input, java.io.File destination)
input
- java.io.InputStreamdestination
- java.io.File
java.io.IOException
- The exception description.private static void writeFile(java.lang.String inputName, java.io.File destination)
input
- java.lang.String - input file name.destination
- java.io.File - destination
java.io.IOException
- The exception description.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |