org.nees.repo.chef.servlets
Class FileTransfer

java.lang.Object
  extended byjavax.servlet.GenericServlet
      extended byjavax.servlet.http.HttpServlet
          extended byorg.nees.repo.chef.servlets.FileTransfer
All Implemented Interfaces:
java.io.Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig

public class FileTransfer
extends javax.servlet.http.HttpServlet

This servlet allows clients using the CHEF metadata browser teamlet to upload and download files to and from the repository. It acts as an NFMS client to negotiate transfers with the repository. It authenticates to the repository by looking up the credential in the HTTP session. The proxy is placed there by the metadata browser. If there is no proxy there, either the user is a guest or the servlet is running in a non-CHEF host. In this case only guest access is permitted.

See Also:
DatabrowserAction, Serialized Form

Field Summary
static java.lang.String CANCEL_VERB_ID
          The "cancel" verb, meaning: "cancel current transfer"
static java.lang.String CHOOSE_VERB_ID
          The "choose" verb, meaning: "have the user choose a file to upload"
static java.lang.String CONFIRM_VERB_ID
          The "confirm" verb, meaning: "confirm operationg complete"
static java.lang.String CONTAINER_ID_LOCAL_PART_PARAMETER_ID
          The ID of the "container ID" parameter, which specifies which container to upload the file to.
static java.lang.String CONTAINER_ID_NAMESPACE_URI_PARAMETER_ID
          The ID of the "container ID" parameter, which specifies which container to upload the file to.
protected static int DIRECTION_DOWNLOAD
           
protected static int DIRECTION_UPLOAD
           
static java.lang.String DOWNLOAD_VERB_ID
          The "download" verb, meaning: "attempt to download a file"
static java.lang.String FILE_TRANSFER_STATE_SESSION_ATTRIBUTE_ID
          The ID of the session attribute for the transfer state
static java.lang.String LOGICAL_NAME_LOCAL_PART_PARAMETER_ID
          The ID of the "logical name" parameter, which specifies the logical name of the file to upload or download.
static java.lang.String LOGICAL_NAME_NAMESPACE_URI_PARAMETER_ID
          The namespace URI for the "logical name" parameter
static java.lang.String NFMS_FACADE_SESSION_ATTRIBUTE_ID
          The ID of the session attribute for the NFMS facade
static java.lang.String PROXY_SESSION_ATTRIBUTE_ID
          The ID of the session attribute for the user's proxy
protected static int STATUS_FAILED
           
protected static int STATUS_IDLE
           
protected static int STATUS_IN_PROGRESS
           
protected static int STATUS_SUCCEEDED
           
static java.lang.String STATUS_VERB_ID
          The "status" verb, meaning: "check status of transfer"
static java.lang.String TITLE_PARAMETER_ID
          The ID of the "title" parameter, which specifies the title of the file to upload.
static java.lang.String UPLOAD_VERB_ID
          The "upload" verb, meaning: "attempt to upload a file"
static java.lang.String VERB_PARAMETER_ID
          The ID of the action "verb", which has one of a set of predefined values
 
Constructor Summary
FileTransfer()
           
 
Method Summary
 void doGet(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp)
           
 void doPost(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp)
           
 void setUploadTemplate()
           
 
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doHead, doOptions, doPut, doTrace, getLastModified, service, service
 
Methods inherited from class javax.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, init, log, log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROXY_SESSION_ATTRIBUTE_ID

public static final java.lang.String PROXY_SESSION_ATTRIBUTE_ID
The ID of the session attribute for the user's proxy

See Also:
Constant Field Values

NFMS_FACADE_SESSION_ATTRIBUTE_ID

public static final java.lang.String NFMS_FACADE_SESSION_ATTRIBUTE_ID
The ID of the session attribute for the NFMS facade

See Also:
Constant Field Values

FILE_TRANSFER_STATE_SESSION_ATTRIBUTE_ID

public static final java.lang.String FILE_TRANSFER_STATE_SESSION_ATTRIBUTE_ID
The ID of the session attribute for the transfer state

See Also:
Constant Field Values

VERB_PARAMETER_ID

public static final java.lang.String VERB_PARAMETER_ID
The ID of the action "verb", which has one of a set of predefined values

See Also:
Constant Field Values

DOWNLOAD_VERB_ID

public static final java.lang.String DOWNLOAD_VERB_ID
The "download" verb, meaning: "attempt to download a file"

See Also:
Constant Field Values

UPLOAD_VERB_ID

public static final java.lang.String UPLOAD_VERB_ID
The "upload" verb, meaning: "attempt to upload a file"

See Also:
Constant Field Values

CHOOSE_VERB_ID

public static final java.lang.String CHOOSE_VERB_ID
The "choose" verb, meaning: "have the user choose a file to upload"

See Also:
Constant Field Values

STATUS_VERB_ID

public static final java.lang.String STATUS_VERB_ID
The "status" verb, meaning: "check status of transfer"

See Also:
Constant Field Values

CANCEL_VERB_ID

public static final java.lang.String CANCEL_VERB_ID
The "cancel" verb, meaning: "cancel current transfer"

See Also:
Constant Field Values

CONFIRM_VERB_ID

public static final java.lang.String CONFIRM_VERB_ID
The "confirm" verb, meaning: "confirm operationg complete"

See Also:
Constant Field Values

LOGICAL_NAME_NAMESPACE_URI_PARAMETER_ID

public static final java.lang.String LOGICAL_NAME_NAMESPACE_URI_PARAMETER_ID
The namespace URI for the "logical name" parameter

See Also:
Constant Field Values

LOGICAL_NAME_LOCAL_PART_PARAMETER_ID

public static final java.lang.String LOGICAL_NAME_LOCAL_PART_PARAMETER_ID
The ID of the "logical name" parameter, which specifies the logical name of the file to upload or download.

See Also:
Constant Field Values

TITLE_PARAMETER_ID

public static final java.lang.String TITLE_PARAMETER_ID
The ID of the "title" parameter, which specifies the title of the file to upload.

See Also:
Constant Field Values

CONTAINER_ID_LOCAL_PART_PARAMETER_ID

public static final java.lang.String CONTAINER_ID_LOCAL_PART_PARAMETER_ID
The ID of the "container ID" parameter, which specifies which container to upload the file to.

See Also:
Constant Field Values

CONTAINER_ID_NAMESPACE_URI_PARAMETER_ID

public static final java.lang.String CONTAINER_ID_NAMESPACE_URI_PARAMETER_ID
The ID of the "container ID" parameter, which specifies which container to upload the file to.

See Also:
Constant Field Values

STATUS_IDLE

protected static final int STATUS_IDLE
See Also:
Constant Field Values

STATUS_IN_PROGRESS

protected static final int STATUS_IN_PROGRESS
See Also:
Constant Field Values

STATUS_SUCCEEDED

protected static final int STATUS_SUCCEEDED
See Also:
Constant Field Values

STATUS_FAILED

protected static final int STATUS_FAILED
See Also:
Constant Field Values

DIRECTION_UPLOAD

protected static final int DIRECTION_UPLOAD
See Also:
Constant Field Values

DIRECTION_DOWNLOAD

protected static final int DIRECTION_DOWNLOAD
See Also:
Constant Field Values
Constructor Detail

FileTransfer

public FileTransfer()
Method Detail

doGet

public void doGet(javax.servlet.http.HttpServletRequest req,
                  javax.servlet.http.HttpServletResponse resp)
           throws javax.servlet.ServletException,
                  java.io.IOException
Throws:
javax.servlet.ServletException
java.io.IOException

doPost

public void doPost(javax.servlet.http.HttpServletRequest req,
                   javax.servlet.http.HttpServletResponse resp)
            throws javax.servlet.ServletException,
                   java.io.IOException
Throws:
javax.servlet.ServletException
java.io.IOException

setUploadTemplate

public void setUploadTemplate()