| java.lang.Object org.apache.turbine.services.xmlrpc.util.FileHandler
All known Subclasses: org.apache.turbine.services.xmlrpc.util.AuthenticatedFileHandler,
FileHandler | public class FileHandler (Code) | | A Handler for use with the XML-RPC service that will deal
with clients sending file to the server (Turbine application)
and clients getting files from the server (Turbine application).
1) In the first case where the client sends a file to the server,
the client has encoded the file contents and passes those
encoded file contents on to the server:
Client --------> encoded file contents -------------> Server
The server must then decode the file contents and write the
decoded file contents to disk.
2) In the second case where the client gets a file from the
the server, the server has encoded the file contents and
passes those encoded file contents on to the client:
Client <------- encoded file contents <------------- Server
The client must then decode the file contents and write the
decoded file contents to disk.
author: Jason van Zyl author: Jon S. Stevens author: Henning P. Schmiedehausen version: $Id: FileHandler.java 534527 2007-05-02 16:10:59Z tv $ |
Method Summary | |
public String | get(String targetLocationProperty, String fileName) The client has indicated that it would like
to get a file from the server.
So a client Turbine application might use the
following bit of code to get a file from a server
Turbine application:
TurbineXmlRpc.executeRpc("file.get", params)
Where:
params.get(0) = the name the file should have when it lands.
params.get(1) = property describing where the file should land.
Parameters: fileName - Name to give the file created to storethe contents. Parameters: targetLocationProperty - storage location of this fileis controlled by this property that is specified inthe TR.props file or an included properties file. | public static String | readFileContents(String targetLocationProperty, String fileName) | public static void | remove(String sourceLocationProperty, String sourceFileName) | public boolean | send(String fileContents, String targetLocationProperty, String fileName) The client has indicated that it would like
to send a file to the server and have it
stored in a certain location on the server.
So a client Turbine application might use the
following bit of code to send a file to a server
Turbine application:
TurbineXmlRpc.executeRpc("file.send", params)
Where:
params.get(0) = contents of the file as a string.
params.get(1) = the name the file should have when it lands.
params.get(2) = property describing where the file should land.
Parameters: fileContents - The contents of the file to store. | public static boolean | writeFileContents(String fileContents, String targetLocationProperty, String fileName) |
FileHandler | public FileHandler()(Code) | | Default Constructor
|
get | public String get(String targetLocationProperty, String fileName)(Code) | | The client has indicated that it would like
to get a file from the server.
So a client Turbine application might use the
following bit of code to get a file from a server
Turbine application:
TurbineXmlRpc.executeRpc("file.get", params)
Where:
params.get(0) = the name the file should have when it lands.
params.get(1) = property describing where the file should land.
Parameters: fileName - Name to give the file created to storethe contents. Parameters: targetLocationProperty - storage location of this fileis controlled by this property that is specified inthe TR.props file or an included properties file. the file contents encoded with base64. |
readFileContents | public static String readFileContents(String targetLocationProperty, String fileName)(Code) | | Return the content of file encoded for transfer
Parameters: targetLocationProperty - path to file to encode. Parameters: fileName - file to encode String encoded contents of the requested file. |
remove | public static void remove(String sourceLocationProperty, String sourceFileName)(Code) | | Method to allow a client to remove a file from
the server
Parameters: sourceLocationProperty - Parameters: sourceFileName - |
send | public boolean send(String fileContents, String targetLocationProperty, String fileName)(Code) | | The client has indicated that it would like
to send a file to the server and have it
stored in a certain location on the server.
So a client Turbine application might use the
following bit of code to send a file to a server
Turbine application:
TurbineXmlRpc.executeRpc("file.send", params)
Where:
params.get(0) = contents of the file as a string.
params.get(1) = the name the file should have when it lands.
params.get(2) = property describing where the file should land.
Parameters: fileContents - The contents of the file to store. Itis assumed that any xml content is properly encoded! Parameters: fileName - Name to give the file created to storethe contents. Parameters: targetLocationProperty - storage location of this fileis controlled by this property that is specified inthe TR.props file or an included properties file. |
writeFileContents | public static boolean writeFileContents(String fileContents, String targetLocationProperty, String fileName)(Code) | | |
|
|