org.apache.turbine.services.xmlrpc.util
Class FileHandler

java.lang.Object
  extended byorg.apache.turbine.services.xmlrpc.util.FileHandler
Direct Known Subclasses:
AuthenticatedFileHandler

Deprecated. This is not scope of the Service itself but of an application which uses the service. This class shouldn't be part of Turbine but of an addon application.

public class FileHandler
extends java.lang.Object

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.

Version:
$Id: FileHandler.java 534527 2007-05-02 16:10:59Z tv $
Author:
Jason van Zyl, Jon S. Stevens, Henning P. Schmiedehausen

Constructor Summary
FileHandler()
          Deprecated. Default Constructor
 
Method Summary
 java.lang.String get(java.lang.String targetLocationProperty, java.lang.String fileName)
          Deprecated. The client has indicated that it would like to get a file from the server.
static java.lang.String readFileContents(java.lang.String targetLocationProperty, java.lang.String fileName)
          Deprecated. Return the content of file encoded for transfer
static void remove(java.lang.String sourceLocationProperty, java.lang.String sourceFileName)
          Deprecated. Method to allow a client to remove a file from the server
 boolean send(java.lang.String fileContents, java.lang.String targetLocationProperty, java.lang.String fileName)
          Deprecated. 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.
static boolean writeFileContents(java.lang.String fileContents, java.lang.String targetLocationProperty, java.lang.String fileName)
          Deprecated.  
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileHandler

public FileHandler()
Deprecated. 
Default Constructor

Method Detail

send

public boolean send(java.lang.String fileContents,
                    java.lang.String targetLocationProperty,
                    java.lang.String fileName)
Deprecated. 
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. It is assumed that any xml content is properly encoded!
fileName - Name to give the file created to store the contents.
targetLocationProperty - storage location of this file is controlled by this property that is specified in the TR.props file or an included properties file.

get

public java.lang.String get(java.lang.String targetLocationProperty,
                            java.lang.String fileName)
Deprecated. 
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 store the contents.
targetLocationProperty - storage location of this file is controlled by this property that is specified in the TR.props file or an included properties file.
Returns:
the file contents encoded with base64.

readFileContents

public static java.lang.String readFileContents(java.lang.String targetLocationProperty,
                                                java.lang.String fileName)
Deprecated. 
Return the content of file encoded for transfer

Parameters:
targetLocationProperty - path to file to encode.
fileName - file to encode
Returns:
String encoded contents of the requested file.

writeFileContents

public static boolean writeFileContents(java.lang.String fileContents,
                                        java.lang.String targetLocationProperty,
                                        java.lang.String fileName)
Deprecated. 

remove

public static void remove(java.lang.String sourceLocationProperty,
                          java.lang.String sourceFileName)
Deprecated. 
Method to allow a client to remove a file from the server

Parameters:
sourceLocationProperty -
sourceFileName -


Copyright © 2000-2008 Apache Software Foundation. All Rights Reserved.