org.benow.web.servlet.sandbox
Class SandboxServlet

java.lang.Object
  extended by javax.servlet.GenericServlet
      extended by javax.servlet.http.HttpServlet
          extended by org.benow.web.servlet.BasicServlet
              extended by org.benow.web.servlet.SimpleServlet
                  extended by org.benow.web.servlet.sandbox.SandboxServlet
All Implemented Interfaces:
java.io.Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig

public class SandboxServlet
extends SimpleServlet

See Also:
Serialized Form

Field Summary
static java.io.File DEFAULT_SANDBOX_ROOT
           
static java.lang.String PARAM_BASE_DIR
           
static java.lang.String PARAM_EXTERNAL_URL
           
 
Fields inherited from class org.benow.web.servlet.BasicServlet
externalURLHttp, externalURLHttps
 
Constructor Summary
SandboxServlet()
           
 
Method Summary
static Credentials createTemporaryCredentials()
          Creates random credentials that are used for fetching of files within a send transaction.
static SandboxServlet getDefaultInstance()
           
static SandboxServlet getSandboxByBaseDir(java.lang.String baseDir)
           
protected  void handle(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, java.io.OutputStream out)
           
 java.net.URL importStream(java.io.File toImport, java.lang.String baseName, Credentials credentials)
           
 java.net.URL importStream(java.io.InputStream metadata, java.lang.String name, Credentials credentials)
          Imports a stream to given name within sandbox and associates with given credentials.
 void init(javax.servlet.ServletConfig config)
           
 
Methods inherited from class org.benow.web.servlet.SimpleServlet
_doGet, doPost, handle
 
Methods inherited from class org.benow.web.servlet.BasicServlet
doGet, logHit
 
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, log, log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PARAM_BASE_DIR

public static final java.lang.String PARAM_BASE_DIR
See Also:
Constant Field Values

PARAM_EXTERNAL_URL

public static final java.lang.String PARAM_EXTERNAL_URL
See Also:
Constant Field Values

DEFAULT_SANDBOX_ROOT

public static final java.io.File DEFAULT_SANDBOX_ROOT
Constructor Detail

SandboxServlet

public SandboxServlet()
Method Detail

init

public void init(javax.servlet.ServletConfig config)
          throws javax.servlet.ServletException
Specified by:
init in interface javax.servlet.Servlet
Overrides:
init in class BasicServlet
Throws:
javax.servlet.ServletException

createTemporaryCredentials

public static Credentials createTemporaryCredentials()
Creates random credentials that are used for fetching of files within a send transaction. Once the send is complete, the credentials (and associated files) are expired.

Returns:
randomly generated credentials

importStream

public java.net.URL importStream(java.io.InputStream metadata,
                                 java.lang.String name,
                                 Credentials credentials)
Imports a stream to given name within sandbox and associates with given credentials.

Parameters:
metadata -
name -
credentials -
Returns:

importStream

public java.net.URL importStream(java.io.File toImport,
                                 java.lang.String baseName,
                                 Credentials credentials)
                          throws java.io.FileNotFoundException
Throws:
java.io.FileNotFoundException

getDefaultInstance

public static SandboxServlet getDefaultInstance()

getSandboxByBaseDir

public static SandboxServlet getSandboxByBaseDir(java.lang.String baseDir)
                                          throws org.benow.repository.NoSuchObjectException
Throws:
org.benow.repository.NoSuchObjectException

handle

protected void handle(javax.servlet.http.HttpServletRequest request,
                      javax.servlet.http.HttpServletResponse response,
                      java.io.OutputStream out)
               throws java.io.IOException
Overrides:
handle in class SimpleServlet
Throws:
java.io.IOException