Elexis API documentation
Version 2.1.6 as of December 11 2011

ch.ngiger.comm.ftp
Class FtpServer

java.lang.Object
  extended by FTPClient
      extended by ch.ngiger.comm.ftp.FtpServer

public class FtpServer
extends FTPClient

This is a basic wrapper around the sun.net.ftp.FtpClient class, which is included with Sun Java that allows you to make FTP connections and file transfers.

Based on programm version 1.0 of Julian Robichaux, http://www.nsftools.com

Version:
1.0
Author:
Immi

Constructor Summary
FtpServer()
           
 
Method Summary
 void addSemaphore(java.lang.String downloadDir, java.lang.String ourFile, java.lang.String theirFile)
          Copy a file to the FTP server as a simple kind of semaphore.
 void closeConnection()
           
 boolean deleteFile(java.lang.String name)
           
 void disconnect()
          Disconnect from Server
 void downloadFile(java.lang.String remoteFilenamePath, java.lang.String localFilenamePath)
          Download a file from the server, and save it to the specified local file
 FTPFile[] listFiles()
          List of files on ftp server
 java.lang.String[] listNames()
          List of filenames on ftp server
 void openConnection(java.lang.String host, java.lang.String user, java.lang.String pwd)
           
 void removeSemaphore()
          praxis.sem auf FTP Server loeschen
 boolean uploadFile(java.lang.String remoteFilenamePath, java.lang.String localFilenamePath)
          Upload a file to the server
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FtpServer

public FtpServer()
Method Detail

downloadFile

public void downloadFile(java.lang.String remoteFilenamePath,
                         java.lang.String localFilenamePath)
                  throws java.io.IOException
Download a file from the server, and save it to the specified local file

Throws:
java.io.IOException

deleteFile

public boolean deleteFile(java.lang.String name)
                   throws java.io.IOException
Throws:
java.io.IOException

uploadFile

public boolean uploadFile(java.lang.String remoteFilenamePath,
                          java.lang.String localFilenamePath)
                   throws java.io.IOException
Upload a file to the server

Throws:
java.io.IOException

disconnect

public void disconnect()
                throws java.io.IOException
Disconnect from Server

Throws:
java.io.IOException

listNames

public java.lang.String[] listNames()
                             throws java.io.IOException
List of filenames on ftp server

Throws:
java.io.IOException

listFiles

public FTPFile[] listFiles()
                    throws java.io.IOException
List of files on ftp server

Throws:
java.io.IOException

openConnection

public void openConnection(java.lang.String host,
                           java.lang.String user,
                           java.lang.String pwd)
                    throws java.io.IOException
Throws:
java.io.IOException

closeConnection

public void closeConnection()
                     throws java.io.IOException
Throws:
java.io.IOException

addSemaphore

public void addSemaphore(java.lang.String downloadDir,
                         java.lang.String ourFile,
                         java.lang.String theirFile)
                  throws FtpSemaException
Copy a file to the FTP server as a simple kind of semaphore. We will upload ourFile. Once this is done, we get the list of all files and verify that their file is not there Not thread safe in any way!!!!

Throws:
FtpSemaException

removeSemaphore

public void removeSemaphore()
                     throws java.io.IOException
praxis.sem auf FTP Server loeschen

Throws:
java.io.IOException

Elexis API documentation
Version 2.1.6 as of December 11 2011

Copyright 2005-2011 by Gerry Weirich, Elexis