ReportMill 12 API

com.reportmill.datasource
Class RMFTPClient

java.lang.Object
  extended by com.reportmill.datasource.RMFTPClient
Direct Known Subclasses:
RMFTPClientRobot

public class RMFTPClient
extends java.lang.Object

A class to establish an FTP connection to get and retrieve files.


Nested Class Summary
 class RMFTPClient.FileInfo
          File Info for an FTP file listing.
static class RMFTPClient.FtpClientPlus
          An FTPClient subclass to promote issueCommand to public.
 
Constructor Summary
RMFTPClient()
          Creates a new ftp client.
RMFTPClient(java.lang.String aHost, java.lang.String aUser, java.lang.String aPassword)
          Creates a new ftp client.
 
Method Summary
 boolean delete(java.lang.String aPath)
          Deletes the file at given path.
 java.lang.String getAbsolutePath(java.lang.String aPath)
          Returns the absolute path given any path (absolute, relative to root path, or relative to cwd).
 byte[] getBytes(java.lang.String aPath)
          Returns the bytes for a path.
 java.lang.String getCurrentDirectory()
          Returns the current directory.
 java.util.List<RMFTPClient.FileInfo> getFileInfoList(java.lang.String aPath)
          Returns the bytes length.
 java.lang.String getHost()
          Returns the host.
 java.lang.String getInitialPath()
          Returns the initial path of the connection.
 java.lang.String getLoginPath()
          Returns the current working directory found at login.
 java.lang.String getPassword()
          Returns the password of the connection.
 java.lang.String getRootPath()
          Returns ftp root path (the login path plus the initial path).
 java.lang.String getUserName()
          Returns the user name of the connection.
 boolean isConnected()
          Returns whether client is connected.
static void main2(java.lang.String[] args)
          Test.
 boolean mkdir(java.lang.String aPath)
          Creates a directory for given path.
 boolean mkdirs(java.lang.String aPath)
          Creates a directory for given path (relative to root path).
 void print(java.lang.String aMessage)
          Prints message.
 void println(java.lang.String aMessage)
          Prints a message with a newline.
 boolean rmdir(java.lang.String aPath)
          Removes a remote directory.
 void setBytes(java.lang.String aPath, byte[] theBytes)
          Sets the bytes for a path.
 boolean setConnected(boolean aValue)
          Sets whether client is connected.
 boolean setCurrentDirectory(java.lang.String aPath)
          Changes directory to given path.
 void setHost(java.lang.String aHost)
          Sets the host.
 void setInitialPath(java.lang.String aPath)
          Sets the initial path of the connection.
 void setPassword(java.lang.String aPassword)
          Sets the password of the connection.
 void setUserName(java.lang.String aUser)
          Sets the user name of the connection.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RMFTPClient

public RMFTPClient()
Creates a new ftp client.


RMFTPClient

public RMFTPClient(java.lang.String aHost,
                   java.lang.String aUser,
                   java.lang.String aPassword)
Creates a new ftp client.

Method Detail

getHost

public java.lang.String getHost()
Returns the host.


setHost

public void setHost(java.lang.String aHost)
Sets the host.


getUserName

public java.lang.String getUserName()
Returns the user name of the connection.


setUserName

public void setUserName(java.lang.String aUser)
Sets the user name of the connection.


getPassword

public java.lang.String getPassword()
Returns the password of the connection.


setPassword

public void setPassword(java.lang.String aPassword)
Sets the password of the connection.


getInitialPath

public java.lang.String getInitialPath()
Returns the initial path of the connection.


setInitialPath

public void setInitialPath(java.lang.String aPath)
Sets the initial path of the connection.


getLoginPath

public java.lang.String getLoginPath()
Returns the current working directory found at login.


getRootPath

public java.lang.String getRootPath()
Returns ftp root path (the login path plus the initial path).


getAbsolutePath

public java.lang.String getAbsolutePath(java.lang.String aPath)
Returns the absolute path given any path (absolute, relative to root path, or relative to cwd). A path is absolute if it starts with root path. A path is relative to root path if it starts with "/" but not root path. A path is relative to current directory if it doesn't start with "/".


isConnected

public boolean isConnected()
Returns whether client is connected.


setConnected

public boolean setConnected(boolean aValue)
Sets whether client is connected.


getCurrentDirectory

public java.lang.String getCurrentDirectory()
Returns the current directory.


setCurrentDirectory

public boolean setCurrentDirectory(java.lang.String aPath)
Changes directory to given path.


getBytes

public byte[] getBytes(java.lang.String aPath)
Returns the bytes for a path.


setBytes

public void setBytes(java.lang.String aPath,
                     byte[] theBytes)
Sets the bytes for a path.


delete

public boolean delete(java.lang.String aPath)
Deletes the file at given path.


getFileInfoList

public java.util.List<RMFTPClient.FileInfo> getFileInfoList(java.lang.String aPath)
Returns the bytes length.


mkdir

public boolean mkdir(java.lang.String aPath)
Creates a directory for given path.


mkdirs

public boolean mkdirs(java.lang.String aPath)
Creates a directory for given path (relative to root path).


rmdir

public boolean rmdir(java.lang.String aPath)
Removes a remote directory.


print

public void print(java.lang.String aMessage)
Prints message.


println

public void println(java.lang.String aMessage)
Prints a message with a newline.


main2

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


ReportMill 12 API