Elexis: Das führende OpenSource-Arztpraxisprogamm
im deutschsprachigen Raum
Java doc für Elexis version 2.1.7.dev vom 01.09.2013

ch.ngiger.comm.ftp
Class FtpServer

java.lang.Object
  extended by org.apache.commons.net.SocketClient
      extended by org.apache.commons.net.telnet.TelnetClient
          extended by org.apache.commons.net.ftp.FTP
              extended by org.apache.commons.net.ftp.FTPClient
                  extended by ch.ngiger.comm.ftp.FtpServer
All Implemented Interfaces:
org.apache.commons.net.ftp.Configurable

public class FtpServer
extends org.apache.commons.net.ftp.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 http://www.nsftools.com/tips/SunFtpWrapper.java


Field Summary
protected static Log log
           
protected static int TERMINAL_TYPE
           
protected static int TERMINAL_TYPE_IS
           
protected static int TERMINAL_TYPE_SEND
           
 
Fields inherited from class org.apache.commons.net.ftp.FTPClient
ACTIVE_LOCAL_DATA_CONNECTION_MODE, ACTIVE_REMOTE_DATA_CONNECTION_MODE, PASSIVE_LOCAL_DATA_CONNECTION_MODE, PASSIVE_REMOTE_DATA_CONNECTION_MODE
 
Fields inherited from class org.apache.commons.net.ftp.FTP
_commandSupport_, ASCII_FILE_TYPE, BINARY_FILE_TYPE, BLOCK_TRANSFER_MODE, CARRIAGE_CONTROL_TEXT_FORMAT, COMPRESSED_TRANSFER_MODE, DEFAULT_CONTROL_ENCODING, DEFAULT_DATA_PORT, DEFAULT_PORT, EBCDIC_FILE_TYPE, FILE_STRUCTURE, IMAGE_FILE_TYPE, LOCAL_FILE_TYPE, NON_PRINT_TEXT_FORMAT, PAGE_STRUCTURE, RECORD_STRUCTURE, STREAM_TRANSFER_MODE, TELNET_TEXT_FORMAT
 
Fields inherited from class org.apache.commons.net.telnet.TelnetClient
readerThread
 
Fields inherited from class org.apache.commons.net.SocketClient
_defaultPort_, _input_, _isConnected_, _output_, _socket_, _socketFactory_, _timeout_, NETASCII_EOL
 
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
 org.apache.commons.net.ftp.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 org.apache.commons.net.ftp.FTPClient
_connectAction_, _openDataConnection_, abort, allocate, allocate, appendFile, appendFileStream, changeToParentDirectory, changeWorkingDirectory, completePendingCommand, configure, createFileList, createFileList, enterLocalActiveMode, enterLocalPassiveMode, enterRemoteActiveMode, enterRemotePassiveMode, getBufferSize, getDataConnectionMode, getPassiveHost, getPassivePort, getRestartOffset, getStatus, getStatus, getSystemName, initiateListParsing, initiateListParsing, initiateListParsing, isRemoteVerificationEnabled, listFiles, listFiles, listFiles, listFiles, listHelp, listHelp, listNames, login, login, logout, makeDirectory, printWorkingDirectory, remoteAppend, remoteRetrieve, remoteStore, remoteStoreUnique, remoteStoreUnique, removeDirectory, rename, retrieveFile, retrieveFileStream, sendNoOp, sendSiteCommand, setBufferSize, setDataTimeout, setFileStructure, setFileTransferMode, setFileType, setFileType, setParserFactory, setRemoteVerificationEnabled, setRestartOffset, storeFile, storeFileStream, storeUniqueFile, storeUniqueFile, storeUniqueFileStream, storeUniqueFileStream, structureMount
 
Methods inherited from class org.apache.commons.net.ftp.FTP
abor, acct, addProtocolCommandListener, allo, allo, appe, cdup, cwd, dele, getControlEncoding, getReply, getReplyCode, getReplyString, getReplyStrings, help, help, list, list, mkd, mode, nlst, nlst, noop, pass, pasv, port, pwd, quit, rein, removeProtocolCommandListener, rest, retr, rmd, rnfr, rnto, sendCommand, sendCommand, sendCommand, sendCommand, setControlEncoding, site, smnt, stat, stat, stor, stou, stou, stru, syst, type, type, user
 
Methods inherited from class org.apache.commons.net.telnet.TelnetClient
addOptionHandler, deleteOptionHandler, getInputStream, getLocalOptionState, getOutputStream, getReaderThread, getRemoteOptionState, registerNotifHandler, registerSpyStream, sendAYT, setReaderThread, stopSpyStream, unregisterNotifHandler
 
Methods inherited from class org.apache.commons.net.SocketClient
connect, connect, connect, connect, connect, connect, getDefaultPort, getDefaultTimeout, getLocalAddress, getLocalPort, getRemoteAddress, getRemotePort, getSoLinger, getSoTimeout, getTcpNoDelay, isConnected, setDefaultPort, setDefaultTimeout, setSocketFactory, setSoLinger, setSoTimeout, setTcpNoDelay, verifyRemote
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected static Log log

TERMINAL_TYPE

protected static final int TERMINAL_TYPE
See Also:
Constant Field Values

TERMINAL_TYPE_SEND

protected static final int TERMINAL_TYPE_SEND
See Also:
Constant Field Values

TERMINAL_TYPE_IS

protected static final int TERMINAL_TYPE_IS
See Also:
Constant Field Values
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
Overrides:
deleteFile in class org.apache.commons.net.ftp.FTPClient
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

Overrides:
disconnect in class org.apache.commons.net.ftp.FTPClient
Throws:
java.io.IOException

listNames

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

Overrides:
listNames in class org.apache.commons.net.ftp.FTPClient
Throws:
java.io.IOException

listFiles

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

Overrides:
listFiles in class org.apache.commons.net.ftp.FTPClient
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: Das führende OpenSource-Arztpraxisprogamm
im deutschsprachigen Raum
Java doc für Elexis version 2.1.7.dev vom 01.09.2013