|
Sun Adapter for Batch/FTP | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.stc.eways.batchext.FtpFileProviderImpl
public class FtpFileProviderImpl
This class provides basic FTP functions. It supports multiple FTP directory-listing styles that are defined as FTP heuristics. You can extend this class to provide your own implementation. This class is also exposed as a node in the FTP ETD.
Constructor Summary | |
---|---|
FtpFileProviderImpl()
Creates a new FtpFileProviderImpl object. |
Method Summary | |
---|---|
boolean |
appendFile(java.lang.String remoteFileName,
java.io.InputStream local)
Appends to a file on the remote FTP server with the given name, taking its input from the given InputStream. |
boolean |
appendFile(java.lang.String remoteFileName,
java.lang.String localFileName)
Appends to a file on the remote FTP server with the given file name, taking the input from the given file name. |
boolean |
appendFile(java.lang.String remoteDirName,
java.lang.String remoteBaseFileName,
java.io.InputStream local)
Appends to a file on the remote FTP server with the given name, taking its input from the given InputStream. |
boolean |
appendFile(java.lang.String remoteDirName,
java.lang.String remoteBaseFileName,
java.lang.String localFileName)
Appends to a file on the server with the given directory and file name, taking its input from the given file name. |
java.io.OutputStream |
appendFileStream(java.lang.String remoteFileName)
Returns an OutputStream through which data can be written. |
java.io.OutputStream |
appendFileStream(java.lang.String dirName,
java.lang.String baseFileName)
Returns an OutputStream through which data can be written. |
boolean |
archiveFile(java.lang.String dirNameFrom,
java.lang.String baseFileNameFrom,
java.lang.String dirNameTo,
java.lang.String baseFileNameTo)
Renames a remote file. |
boolean |
ascii()
Sets the file type of the file to be transferred, to ASCII. |
boolean |
binary()
Sets the file type of the file to be transferred, to binary. |
boolean |
cd(java.lang.String dirName)
Changes the current working directory of the FTP session. |
boolean |
completePendingCommand()
Receives an FTPClient method's completion reply from the server and verifies the success of the entire transaction, after the programmer's code completes its actions. |
void |
connect(java.lang.String host,
int port)
Opens a socket connected to a remote FTP host at the specified port and originating from the current host at a system-assigned port. |
void |
connect(java.lang.String host,
int port,
java.lang.String encoding)
Opens a socket connected to a remote FTP host at the specified port and originating from the current host at a system-assigned port. |
boolean |
deleteFile(java.lang.String remoteFileName)
Deletes a file on the remote FTP server. |
boolean |
deleteFile(java.lang.String dirName,
java.lang.String baseFileName)
Deletes a file on the remote FTP server. |
void |
disConnect()
Closes the connection to the remote FTP server and restores the e*Way Connection parameters to the default values. |
boolean |
ebcdic()
Sets the file type of the file to be transferred, to EBCDIC. |
int |
getDataConnectionMode()
Returns the current data connection mode (one of the _DATA_CONNECTION_MODE constants). |
com.oroinc.net.ftp.FTPFileListParser |
getDefaultFileListParser()
Retrieves the defaultFileListParser object |
com.oroinc.net.ftp.FTPClient |
getDelegate()
Retrieves the delegate object |
java.lang.String |
getFirstFileName(java.lang.String dir,
boolean isDirRegex,
java.lang.String file,
boolean isFileRegex)
Get the first matching remote file name based on the remote directory regular expression and the remote file regular expression. |
FtpHeuristics |
getHeuristics()
Retrieves an FtpHeuristics object. |
int |
getReplyCode()
Returns the integer value of the reply code of the last FTP reply. |
java.lang.String |
getReplyString()
Returns the entire text of the last FTP server response exactly as it was received. |
java.lang.String[] |
getReplyStrings()
Returns the lines of text from the last FTP server response as an array of strings, with one entry per line. |
int |
getSoLinger()
Returns the current SO_LINGER timeout (in seconds) of the currently opened socket. |
int |
getSoTimeout()
Returns the timeout, in milliseconds, of the currently opened socket. |
java.lang.String |
getSystemName()
Retrieves the system type name from the server and returns the string. |
boolean |
getTcpNoDelay()
Allows you to determine whether Nagle's algorithm is enabled on the currently opened socket. |
boolean |
image()
Sets the file type of the file to be transferred, to "Image." |
void |
initialize(FtpETD etd)
Initializes the FTP ETD object. |
boolean |
isConnected()
Checks on whether the client is currently connected to a server. |
boolean |
isNegativePermanent(int replyCode)
Checks on whether the FTP operation is "Negative Permanent;" the return code can be any integer from 500 through 599. |
boolean |
isNegativeTransient(int replyCode)
Checks on whether the FTP operation is "Negative Transient;" the return code can be any integer from 400 through 499. |
boolean |
isPositiveCompletion(int replyCode)
Checks on whether the FTP operation is "Positive Completion;" the return code can be any integer from 200 through 299. |
boolean |
isPositiveIntermediate(int replyCode)
Checks on whether the FTP operation is "Positive Intermediate;" the return code can be any integer from 300 through 399. |
boolean |
isPositivePreliminary(int replyCode)
Checks on whether the FTP operation is "Positive Preliminary;" the return code can be any integer from 100 through 199. |
boolean |
isRemoteVerificationEnabled()
Allows you to determine whether verification of the remote FTP host participating in data connections is enabled. |
boolean |
isTraceRawCommand()
Check on whether the trace flag is on. |
java.lang.String[] |
listFileNames(com.oroinc.net.ftp.FTPFile[] files)
Gets the name for all file entries that are related to real file data. |
java.lang.String[] |
listFileNames(java.lang.String dir,
boolean isDirRegex,
java.lang.String file,
boolean isFileRegex)
Lists the remote full file names based on the remote directory regular expression and remote file regular expression. |
com.oroinc.net.ftp.FTPFile[] |
listFiles()
Using the default FileListParser , obtains a list of file information for the current working directory. |
com.oroinc.net.ftp.FTPFile[] |
listFiles(com.oroinc.net.ftp.FTPFile[] files,
boolean listRealData)
Gets all file entries that can be used to get real data, when the parameter listRealData is true. |
com.oroinc.net.ftp.FTPFile[] |
listFiles(com.oroinc.net.ftp.FTPFile[] files,
int fileType)
Filters files by type. |
com.oroinc.net.ftp.FTPFile[] |
listFiles(java.lang.String pathName)
Using default FileListParser, obtains a list of file information for the given working directory. |
com.oroinc.net.ftp.FTPFile[] |
listFiles(java.lang.String pathName,
java.lang.String regExp)
Using the default FileListParser, obtains a list of file information for the given working directory and regular expression. |
java.lang.String |
listHelp()
Retrieves the system help information from the remote FTP server and returns the full string. |
java.lang.String |
listHelp(java.lang.String command)
Retrieves the help information for a given command from the remote FTP server and returns the full string. |
boolean |
login(java.lang.String user,
java.lang.String password)
Logs into the remote FTP server using the provided user name and password. |
boolean |
logout()
Logs out of the remote FTP server by sending the QUIT command. |
static void |
main(java.lang.String[] args)
Used to do stand-alone testing. |
boolean |
mkdir(java.lang.String dir)
Creates a new directory if the directory does not exist. |
boolean |
mkdirs(java.lang.String dir)
Creates a new directory if the directory does not exist. |
java.lang.String |
pwd()
Returns the path name of the current working directory. |
boolean |
rename(java.lang.String remoteFileNameFrom,
java.lang.String remoteFileNameTo)
Renames a remote file. |
boolean |
rename(java.lang.String dirNameFrom,
java.lang.String baseFileNameFrom,
java.lang.String dirNameTo,
java.lang.String baseFileNameTo)
Renames a remote file. |
boolean |
retrieveFile(java.lang.String remoteFileName,
java.io.OutputStream local)
Retrieves a named file from the remote FTP server and writes it to the given OutputStream. |
boolean |
retrieveFile(java.lang.String remoteFileName,
java.lang.String localFileName)
Retrieves a named file from the remote FTP server and writes it to the given local file. |
boolean |
retrieveFile(java.lang.String remoteDirName,
java.lang.String remoteBaseFileName,
java.io.OutputStream local)
Retrieves a named file from the remote FTP server and writes it to the given OutputStream. |
boolean |
retrieveFile(java.lang.String remoteDirName,
java.lang.String remoteBaseFileName,
java.lang.String localFileName)
Retrieves a named file from the remote FTP server and writes it to the given local file. |
java.io.InputStream |
retrieveFileStream(java.lang.String remoteFileName)
Returns an InputStream from which a named file from the remote FTP server can be read. |
java.io.InputStream |
retrieveFileStream(java.lang.String dirName,
java.lang.String baseFileName)
Returns an InputStream from which a named file from the remote FTP server can be read. |
boolean |
rmdir(java.lang.String dirName)
Removes a directory on the FTP server, if it is empty. |
int |
sendCommand(java.lang.String command)
Sends an FTP command without a parameter to the remote FTP server. |
int |
sendCommand(java.lang.String command,
java.lang.String parm)
Sends an FTP command to the server. |
boolean |
sendSiteCommand(java.lang.String command)
send a site command to FTP server |
void |
setDataSocketTimeout(int timeout)
Sets the timeout, in milliseconds, to use when reading from the data connection. |
void |
setDefaultFileListParser(com.oroinc.net.ftp.FTPFileListParser parser)
Sets the defaultFileListParser object |
void |
setDelegate(com.oroinc.net.ftp.FTPClient client)
Sets the delegate object |
void |
setDirListingStyle(java.lang.String dirListingStyle)
Initializes and updates the FTP heuristics using a specified directory-listing style. |
void |
setHeuristics(FtpHeuristics heuristics)
Sets the heuristics object |
void |
setRemoteVerificationEnabled(boolean enable)
Allows you to enable or disable verification that the remote FTP host taking part in a given data connection is the same as the host to which the control connection is attached. |
void |
setSocketFactory(com.oroinc.net.SocketFactory factory)
Sets the SocketFactory used by the SocketClient to open socket connections. |
void |
setSoLinger(boolean on,
int val)
Sets the SO_LINGER timeout (in seconds) on the currently opened command socket. |
void |
setSoTimeout(int timeout)
Sets the timeout, in milliseconds, of a currently open command connection. |
void |
setTcpNoDelay(boolean on)
Allows you to enable or disable the Nagle's algorithm (TCP_NODELAY) on the currently opened command socket. |
void |
setTraceRawCommand(boolean newTraceRawCommand)
Allows you to turn the trace flag on and off. |
void |
setUserDefinedHeuristicsInfo(java.lang.String userDefinedDirListingStyle,
java.lang.String userDefinedHeuristicsCfgFile)
Initializes and updates the FTP heuristics using a user specified directory-listing style. |
boolean |
storeFile(java.lang.String remoteFileName,
java.io.InputStream local)
Stores a file on the remote FTP server using the given name and taking its input from the given InputStream. |
boolean |
storeFile(java.lang.String remoteFileName,
java.lang.String localFileName)
Stores a file on the server using the given name and taking its input from the given local file. |
boolean |
storeFile(java.lang.String remoteDirName,
java.lang.String remoteBaseFileName,
java.io.InputStream local)
Stores a file on the remote FTP server using the given name and taking its input from the given InputStream. |
boolean |
storeFile(java.lang.String remoteDirName,
java.lang.String remoteBaseFileName,
java.lang.String localFileName)
Stores a file on the remote FTP server using the given name and taking its input from the given local file. |
java.io.OutputStream |
storeFileStream(java.lang.String remoteFileName)
Returns an OutputStream through which data can be written to store a file on the server using the given name. |
java.io.OutputStream |
storeFileStream(java.lang.String dirName,
java.lang.String baseFileName)
Returns an OutputStream through which data can be written. |
void |
useActive()
Sets the current data connection mode to ACTIVE_LOCAL_DATA_CONNECTION_MODE. |
void |
usePassive()
Sets the current data connection mode to PASSIVE_LOCAL_DATA_CONNECTION_MODE. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected com.stc.connector.logging.Logger mLogger
public static final int DEFAULT_TIMEOUT_DATA_CONNECTION
public static final int DEFAULT_TIMEOUT_COMMAND_CONNECTION
public static final int ACTION_ABORTED
public static final int BAD_COMMAND_SEQUENCE
public static final int CANNOT_OPEN_DATA_CONNECTION
public static final int CLOSING_DATA_CONNECTION
public static final int COMMAND_IS_SUPERFLUOUS
public static final int COMMAND_NOT_IMPLEMENTED
public static final int COMMAND_NOT_IMPLEMENTED_FOR_PARAMETER
public static final int COMMAND_OK
public static final int DATA_CONNECTION_ALREADY_OPEN
public static final int DATA_CONNECTION_OPEN
public static final int DIRECTORY_STATUS
public static final int ENTERING_PASSIVE_MODE
public static final int FILE_ACTION_NOT_TAKEN
public static final int FILE_ACTION_OK
public static final int FILE_ACTION_PENDING
public static final int FILE_NAME_NOT_ALLOWED
public static final int FILE_STATUS
public static final int FILE_STATUS_OK
public static final int FILE_UNAVAILABLE
public static final int HELP_MESSAGE
public static final int INSUFFICIENT_STORAGE
public static final int NAME_SYSTEM_TYPE
public static final int NEED_ACCOUNT
public static final int NEED_ACCOUNT_FOR_STORING_FILES
public static final int NEED_PASSWORD
public static final int NOT_LOGGED_IN
public static final int PAGE_TYPE_UNKNOWN
public static final int PATHNAME_CREATED
public static final int RESTART_MARKER
public static final int SERVICE_CLOSING_CONTROL_CONNECTION
public static final int SERVICE_NOT_AVAILABLE
public static final int SERVICE_NOT_READY
public static final int SERVICE_READY
public static final int STORAGE_ALLOCATION_EXCEEDED
public static final int SYNTAX_ERROR_IN_ARGUMENTS
public static final int SYSTEM_STATUS
public static final int TRANSFER_ABORTED
public static final int UNRECOGNIZED_COMMAND
public static final int USER_LOGGED_IN
Constructor Detail |
---|
public FtpFileProviderImpl() throws java.lang.Exception
java.lang.Exception
Method Detail |
---|
public com.oroinc.net.ftp.FTPFile[] listFiles() throws java.io.IOException
listFiles
in interface FtpFileProvider
java.io.IOException
- If some error occurs.public com.oroinc.net.ftp.FTPFile[] listFiles(java.lang.String pathName) throws java.io.IOException
listFiles
in interface FtpFileProvider
pathName
- The directory name.
java.io.IOException
- If some error occurs.public com.oroinc.net.ftp.FTPFile[] listFiles(com.oroinc.net.ftp.FTPFile[] files, int fileType) throws java.io.IOException
listFiles
in interface FtpFileProvider
files
- An array of FTP ETD objects.fileType
- The file type.
java.io.IOException
- If some error occurs.public com.oroinc.net.ftp.FTPFile[] listFiles(java.lang.String pathName, java.lang.String regExp) throws java.io.IOException
listFiles
in interface FtpFileProvider
pathName
- The directory name.regExp
- The file name regular expression.
java.io.IOException
- If some error occurs.public boolean appendFile(java.lang.String remoteFileName, java.lang.String localFileName) throws java.io.IOException
appendFile
in interface FtpFileProvider
remoteFileName
- The remote file name.localFileName
- The local file name.
java.io.IOException
- If some error occurs.public java.io.OutputStream appendFileStream(java.lang.String dirName, java.lang.String baseFileName) throws java.io.IOException
appendFileStream
in interface FtpFileProvider
dirName
- The remote directory name.baseFileName
- The remote base file name.
java.io.IOException
- If some error occurs.public boolean deleteFile(java.lang.String dirName, java.lang.String baseFileName) throws java.io.IOException
deleteFile
in interface FtpFileProvider
dirName
- The remote directory name of the file.baseFileName
- The base name of the file.
java.io.IOException
- If some error occurs.public boolean isTraceRawCommand()
isTraceRawCommand
in interface FtpFileProvider
public boolean rename(java.lang.String dirNameFrom, java.lang.String baseFileNameFrom, java.lang.String dirNameTo, java.lang.String baseFileNameTo) throws java.io.IOException
rename
in interface FtpFileProvider
dirNameFrom
- The remote directory name.baseFileNameFrom
- The remote base file name.dirNameTo
- The remote directory name.baseFileNameTo
- The remote base file name.
java.io.IOException
- If some error occurs.public boolean retrieveFile(java.lang.String remoteFileName, java.lang.String localFileName) throws java.io.IOException
retrieveFile
in interface FtpFileProvider
remoteFileName
- The remote file name.localFileName
- The local file name.
java.io.IOException
- If some error occurs.public java.io.InputStream retrieveFileStream(java.lang.String dirName, java.lang.String baseFileName) throws java.io.IOException
retrieveFileStream
in interface FtpFileProvider
dirName
- The remote directory name.baseFileName
- The remote base file name.
java.io.IOException
- If some error occurs.public int sendCommand(java.lang.String command, java.lang.String parm) throws java.io.IOException
sendCommand
in interface FtpFileProvider
command
- The FTP command to be executed.parm
- The parameter of the FTP command.
java.io.IOException
- If some error occurs.public void setTraceRawCommand(boolean newTraceRawCommand)
setTraceRawCommand
in interface FtpFileProvider
newTraceRawCommand
- true or false.public boolean storeFile(java.lang.String remoteFileName, java.lang.String localFileName) throws java.io.IOException
storeFile
in interface FtpFileProvider
remoteFileName
- The remote file name.localFileName
- The local file name.
java.io.IOException
- If some error occurs.public java.io.OutputStream storeFileStream(java.lang.String dirName, java.lang.String baseFileName) throws java.io.IOException
storeFileStream
in interface FtpFileProvider
remoteFileName
- The remote file name.baseFileName
- The remote base file name.
java.io.IOException
- If some error occurs.public boolean appendFile(java.lang.String remoteDirName, java.lang.String remoteBaseFileName, java.lang.String localFileName) throws java.io.IOException
appendFile
in interface FtpFileProvider
remoteDirName
- The remote directory name.remoteBaseFileName
- The remote base file name.localFileName
- The local file name.
java.io.IOException
- If some error occurs.public boolean retrieveFile(java.lang.String remoteDirName, java.lang.String remoteBaseFileName, java.lang.String localFileName) throws java.io.IOException
retrieveFile
in interface FtpFileProvider
remoteDirName
- The remote directory name.remoteBaseFileName
- The remote base file name.localFileName
- The local file name.
java.io.IOException
- If some error occurs.public boolean storeFile(java.lang.String remoteDirName, java.lang.String remoteBaseFileName, java.lang.String localFileName) throws java.io.IOException
storeFile
in interface FtpFileProvider
remoteDirName
- The remote directory name.remoteBaseFileName
- The remote file name.localFileName
- The local file name.
java.io.IOException
- If some error occurs.public com.oroinc.net.ftp.FTPFile[] listFiles(com.oroinc.net.ftp.FTPFile[] files, boolean listRealData) throws java.io.IOException
listFiles
in interface FtpFileProvider
files
- An array of FTPFile objects.listRealData
- Indicates whether the files listed contain real data.
java.io.IOException
- If some error occurs.public int getReplyCode()
getReplyCode
in interface FtpFileProvider
public java.lang.String getReplyString()
getReplyString
in interface FtpFileProvider
public java.lang.String[] getReplyStrings()
getReplyStrings
in interface FtpFileProvider
public boolean appendFile(java.lang.String remoteFileName, java.io.InputStream local) throws java.io.IOException
appendFile
in interface FtpFileProvider
remoteFileName
- The remote file name.local
- The local input stream.
java.io.IOException
- If some error occurs.public boolean appendFile(java.lang.String remoteDirName, java.lang.String remoteBaseFileName, java.io.InputStream local) throws java.io.IOException
appendFile
in interface FtpFileProvider
remoteDirName
- The remote directory name.remoteBaseFileName
- The remote base file name.local
- The local input stream.
java.io.IOException
- If some error occurs.public java.io.OutputStream appendFileStream(java.lang.String remoteFileName) throws java.io.IOException
appendFileStream
in interface FtpFileProvider
remoteFileName
- The remote file name.
java.io.IOException
- If some error occurs.public boolean ascii() throws java.io.IOException
ascii
in interface FtpFileProvider
java.io.IOException
- If some error occurs.public boolean binary() throws java.io.IOException
binary
in interface FtpFileProvider
java.io.IOException
- If some error occurs.public boolean cd(java.lang.String dirName) throws java.io.IOException
cd
in interface FtpFileProvider
dirName
- The new directory name.
java.io.IOException
- If some error occurs.public void connect(java.lang.String host, int port) throws java.net.SocketException, java.io.IOException
connect
in interface FtpFileProvider
host
- The FTP host name.port
- The FTP server port.
java.net.SocketException
- If some socket error occurs.
java.io.IOException
- If some input-output error occurs.public void connect(java.lang.String host, int port, java.lang.String encoding) throws java.net.SocketException, java.io.IOException
connect
in interface FtpFileProvider
host
- The FTP host name.port
- The FTP server port.encoding
- The encoding for the server.
java.net.SocketException
- If some socket error occurs.
java.io.IOException
- If some input-output error occurs.public boolean deleteFile(java.lang.String remoteFileName) throws java.io.IOException
deleteFile
in interface FtpFileProvider
remoteFileName
- The name of the remote file to be deleted.
java.io.IOException
- If some error occurs.public int getDataConnectionMode()
getDataConnectionMode
in interface FtpFileProvider
public java.lang.String getSystemName() throws java.io.IOException
getSystemName
in interface FtpFileProvider
java.io.IOException
- If some error occurs.public boolean image() throws java.io.IOException
image
in interface FtpFileProvider
java.io.IOException
- If some error occurs.public boolean isConnected()
isConnected
in interface FtpFileProvider
public boolean isNegativePermanent(int replyCode)
isNegativePermanent
in interface FtpFileProvider
replyCode
- The reply code of the FTP operation.
public boolean isNegativeTransient(int replyCode)
isNegativeTransient
in interface FtpFileProvider
replyCode
- The reply code of the FTP operation.
public boolean isPositiveCompletion(int replyCode)
isPositiveCompletion
in interface FtpFileProvider
replyCode
- The reply code of the FTP operation.
public boolean isPositiveIntermediate(int replyCode)
isPositiveIntermediate
in interface FtpFileProvider
replyCode
- The reply code of the FTP operation.
public boolean isPositivePreliminary(int replyCode)
isPositivePreliminary
in interface FtpFileProvider
replyCode
- The reply code of the FTP operation.
public java.lang.String listHelp() throws java.io.IOException
listHelp
in interface FtpFileProvider
java.io.IOException
- If some error occurs.public java.lang.String listHelp(java.lang.String command) throws java.io.IOException
listHelp
in interface FtpFileProvider
command
- The command given.
java.io.IOException
- If some error occurs.public boolean login(java.lang.String user, java.lang.String password) throws java.io.IOException
login
in interface FtpFileProvider
user
- The user name.password
- The password.
java.io.IOException
- If some error occurs.public boolean logout() throws java.io.IOException
logout
in interface FtpFileProvider
java.io.IOException
- If some error occurs.public java.lang.String pwd() throws java.io.IOException
pwd
in interface FtpFileProvider
java.io.IOException
- If some error occurs.public boolean rename(java.lang.String remoteFileNameFrom, java.lang.String remoteFileNameTo) throws java.io.IOException
rename
in interface FtpFileProvider
remoteFileNameFrom
- The old remote file name.remoteFileNameTo
- The new remote file name.
java.io.IOException
- If some error occurs.public boolean retrieveFile(java.lang.String remoteFileName, java.io.OutputStream local) throws java.io.IOException
retrieveFile
in interface FtpFileProvider
remoteFileName
- The remote file name.local
- The local output stream.
java.io.IOException
- If some error occurs.public boolean retrieveFile(java.lang.String remoteDirName, java.lang.String remoteBaseFileName, java.io.OutputStream local) throws java.io.IOException
retrieveFile
in interface FtpFileProvider
remoteDirName
- The remote directory name.remoteBaseFileName
- The remote base file name.local
- The local output stream.
java.io.IOException
- If some error occurs.public java.io.InputStream retrieveFileStream(java.lang.String remoteFileName) throws java.io.IOException
retrieveFileStream
in interface FtpFileProvider
remoteFileName
- The remote file name.
java.io.IOException
- If some error occurs.public int sendCommand(java.lang.String command) throws java.io.IOException
sendCommand
in interface FtpFileProvider
command
- The FTP command to be executed.
java.io.IOException
- If some error occurs.public boolean sendSiteCommand(java.lang.String command) throws java.io.IOException
sendSiteCommand
in interface FtpFileProvider
command
- - site command
java.io.IOException
public boolean storeFile(java.lang.String remoteFileName, java.io.InputStream local) throws java.io.IOException
storeFile
in interface FtpFileProvider
remoteFileName
- The remote file name.local
- The local input stream.
java.io.IOException
- If some error occurs.public boolean storeFile(java.lang.String remoteDirName, java.lang.String remoteBaseFileName, java.io.InputStream local) throws java.io.IOException
storeFile
in interface FtpFileProvider
remoteDirName
- The remote directory name.remoteBaseFileName
- The remote file name.local
- The local input stream.
java.io.IOException
- If some error occurs.public java.io.OutputStream storeFileStream(java.lang.String remoteFileName) throws java.io.IOException
storeFileStream
in interface FtpFileProvider
remoteFileName
- The remote file name.
java.io.IOException
- If some error occurs.public void useActive()
useActive
in interface FtpFileProvider
public void usePassive()
usePassive
in interface FtpFileProvider
public boolean archiveFile(java.lang.String dirNameFrom, java.lang.String baseFileNameFrom, java.lang.String dirNameTo, java.lang.String baseFileNameTo) throws java.io.IOException
archiveFile
in interface FtpFileProvider
dirNameFrom
- The remote directory name.baseFileNameFrom
- The remote base file name.dirNameTo
- The remote directory name.baseFileNameTo
- The remote base file name.
java.io.IOException
- If some error occurs.public boolean completePendingCommand() throws java.io.IOException
completePendingCommand
in interface FtpFileProvider
java.io.IOException
- If some error occurs.public java.lang.String[] listFileNames(com.oroinc.net.ftp.FTPFile[] files) throws java.io.IOException
listFileNames
in interface FtpFileProvider
files
- An array of FTP ETD objects.
java.io.IOException
- If some error occurs.public FtpHeuristics getHeuristics()
getHeuristics
in interface FtpFileProvider
public boolean mkdir(java.lang.String dir) throws java.io.IOException
mkdir
in interface FtpFileProvider
dir
- The directory name to be created.
java.io.IOException
- If some error occurs.public boolean mkdirs(java.lang.String dir) throws java.io.IOException
mkdirs
in interface FtpFileProvider
dir
- The directory name to be created.
java.io.IOException
- If some error occurs.public void setSocketFactory(com.oroinc.net.SocketFactory factory)
setSocketFactory
in interface FtpFileProvider
factory
- The new SocketFactory the SocketClient must use.public void disConnect() throws java.io.IOException
disConnect
in interface FtpFileProvider
java.io.IOException
- If some error occurs.public boolean ebcdic() throws java.io.IOException
ebcdic
in interface FtpFileProvider
java.io.IOException
- If some error occurs.public int getSoLinger() throws java.net.SocketException
getSoLinger
in interface FtpFileProvider
java.net.SocketException
- If the operation fails.public int getSoTimeout() throws java.net.SocketException
getSoTimeout
in interface FtpFileProvider
java.net.SocketException
- If the operation fails.public boolean getTcpNoDelay() throws java.net.SocketException
getTcpNoDelay
in interface FtpFileProvider
java.net.SocketException
- If the operation fails.public boolean isRemoteVerificationEnabled()
isRemoteVerificationEnabled
in interface FtpFileProvider
public static void main(java.lang.String[] args)
args
- Command-line parameters.public void setRemoteVerificationEnabled(boolean enable)
setRemoteVerificationEnabled
in interface FtpFileProvider
enable
- true enables verification, and false disables it.public void setSoLinger(boolean on, int val) throws java.net.SocketException
setSoLinger
in interface FtpFileProvider
on
- true if the timeout is to be enabled, and false if not.val
- The timeout in seconds (in hundredths of a second?)
java.net.SocketException
- If the operation fails.public void setSoTimeout(int timeout) throws java.net.SocketException
setSoTimeout
in interface FtpFileProvider
timeout
- The timeout, in milliseconds, to use for the currently
open command connection socket.
java.net.SocketException
- If the operation fails.public void setTcpNoDelay(boolean on) throws java.net.SocketException
setTcpNoDelay
in interface FtpFileProvider
on
- true to enable Nagle's algorithm, and false to disable.
java.net.SocketException
- If the operation fails.public boolean rmdir(java.lang.String dirName) throws java.io.IOException
rmdir
in interface FtpFileProvider
dirName
- The name of the remote directory to remove.
java.io.IOException
- If some error occurs.public void setDataSocketTimeout(int timeout)
setDataSocketTimeout
in interface FtpFileProvider
timeout
- The timeout, in milliseconds, that is used when
opening a data connection socket.public void initialize(FtpETD etd) throws FtpFileException
initialize
in interface FtpFileProvider
etd
- The FTP ETD instance.
FtpFileException
- If some error occurs.public void setDirListingStyle(java.lang.String dirListingStyle) throws java.lang.Exception
setDirListingStyle
in interface FtpFileProvider
dirListingStyle
- The directory-listing style.
java.lang.Exception
- If some error occurs.public void setUserDefinedHeuristicsInfo(java.lang.String userDefinedDirListingStyle, java.lang.String userDefinedHeuristicsCfgFile) throws java.lang.Exception
setUserDefinedHeuristicsInfo
in interface FtpFileProvider
userDefinedDirListingStyle
- The user defined directory-listing style.userDefinedHeuristicsCfgFile
- The heuristics configuration file path on logical host
containing user defined heuristics information.
java.lang.Exception
- If error occurs.public java.lang.String getFirstFileName(java.lang.String dir, boolean isDirRegex, java.lang.String file, boolean isFileRegex) throws java.io.IOException
getFirstFileName
in interface FtpFileProvider
dir
- The directory name.isDirRegex
- Determines whether the directory name is a regular expression.file
- The file name.isFileRegex
- Determines whether the file name is a regular expression.
java.io.IOException
- If some error occurs.public java.lang.String[] listFileNames(java.lang.String dir, boolean isDirRegex, java.lang.String file, boolean isFileRegex) throws java.io.IOException
listFileNames
in interface FtpFileProvider
dir
- The directory name.isDirRegex
- Determines whether the directory name is a regular expression.file
- The file name.isFileRegex
- Determines whether the file name is a regular expression.
java.io.IOException
- If some error occurs.public com.oroinc.net.ftp.FTPFileListParser getDefaultFileListParser()
public com.oroinc.net.ftp.FTPClient getDelegate()
public void setDefaultFileListParser(com.oroinc.net.ftp.FTPFileListParser parser)
parser
- FTPFileListParser instancepublic void setDelegate(com.oroinc.net.ftp.FTPClient client)
client
- FTPClient instancepublic void setHeuristics(FtpHeuristics heuristics)
heuristics
- FtpHeuristics instance
|
Sun Adapter for Batch/FTP | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |