com.ibm.ram.repository.web
Class DownloadArtifact

java.lang.Object
  extended by javax.servlet.GenericServlet
      extended by javax.servlet.http.HttpServlet
          extended by com.ibm.ram.repository.web.DownloadArtifact
All Implemented Interfaces:
java.io.Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig

public class DownloadArtifact
extends javax.servlet.http.HttpServlet

Represents the servlet that allows a user to download an artifact from a given IAsset or an attachment.

For artifacts, the URL after the server path is of the following form:

Download artifact from persisted asset
/artifact/guid/version/folder1/folder2/filename where there can be zero or more folders.
Download artifact from persisted asset where the asset is a submission asset
/artifact/submission/guid/version/folder1/folder2/filename where there can be zero or more folders.
Download artifact from the upload staging area (including going to the saved asset for artifacts that are not currently being updated)
/artifact/upload/submitID/folder1/folder2/filename where there can be zero or more folders. The "submitID" is the unique identification of the submit handler for the session. If this id is not the same as the current sessions submithandler id then we know this is an old link and file not found. The submitID will be recreated whenever the submit handler is reinitialized for an asset so that it will unique per asset being edited. This way if version changes during editing we can still find the asset files.
Download manifest from asset
/artifact/guid/version/._schema or /artifact/submission/guid/version/._schema
Download an attachment
/attachment/attachmentid where attachment id is the database id of the attachment record.
Download a preview
/preview/... where "..." is the same as for artifact (either from persisted asset, uploaded asset, or schema).

See Also:
Serialized Form

Field Summary
static java.lang.String DOWNLOAD_ID_PARAM
           
static java.lang.String DOWNLOAD_ID_SESSION_PARAM
           
static java.lang.String downloadAttachmentURI
           
static int downloadImagePreviewHeight
           
static int downloadImagePreviewWidth
           
static java.lang.String downloadPreviewURI
           
static java.lang.String downloadSchemaURI
           
static java.lang.String downloadURI
           
static java.lang.String submissionURI
           
static java.lang.String uploadStagingURI
           
 
Constructor Summary
DownloadArtifact()
           
 
Method Summary
static java.lang.String getContentDisposition(java.lang.String fileName, java.lang.String extension, javax.servlet.http.HttpServletRequest request, com.ibm.ram.common.util.InputStreamInformation isInfo, long skippedBytes, java.lang.Boolean attachment)
           
static java.lang.String getPOSTContentDisposition(java.lang.String fileName, java.lang.String extension, javax.faces.context.FacesContext facesContext, com.ibm.ram.common.util.InputStreamInformation isInfo, long skippedBytes)
           
static boolean isImageType(java.lang.String mimeType)
           
static boolean isPreviewableFileType(java.lang.String mimeType)
           
 
Methods inherited from class javax.servlet.http.HttpServlet
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
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DOWNLOAD_ID_PARAM

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

DOWNLOAD_ID_SESSION_PARAM

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

downloadURI

public static java.lang.String downloadURI

downloadSchemaURI

public static java.lang.String downloadSchemaURI

uploadStagingURI

public static java.lang.String uploadStagingURI

downloadPreviewURI

public static java.lang.String downloadPreviewURI

downloadAttachmentURI

public static java.lang.String downloadAttachmentURI

submissionURI

public static java.lang.String submissionURI

downloadImagePreviewWidth

public static int downloadImagePreviewWidth

downloadImagePreviewHeight

public static int downloadImagePreviewHeight
Constructor Detail

DownloadArtifact

public DownloadArtifact()
Method Detail

isImageType

public static boolean isImageType(java.lang.String mimeType)

isPreviewableFileType

public static boolean isPreviewableFileType(java.lang.String mimeType)

getPOSTContentDisposition

public static java.lang.String getPOSTContentDisposition(java.lang.String fileName,
                                                         java.lang.String extension,
                                                         javax.faces.context.FacesContext facesContext,
                                                         com.ibm.ram.common.util.InputStreamInformation isInfo,
                                                         long skippedBytes)

getContentDisposition

public static java.lang.String getContentDisposition(java.lang.String fileName,
                                                     java.lang.String extension,
                                                     javax.servlet.http.HttpServletRequest request,
                                                     com.ibm.ram.common.util.InputStreamInformation isInfo,
                                                     long skippedBytes,
                                                     java.lang.Boolean attachment)