|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.ibm.ram.repository.web.DownloadUtilities
public class DownloadUtilities
Field Summary | |
---|---|
static java.lang.String |
ECLIPSE_P2SITE_ARTIFACTS_JAR
|
static java.lang.String |
ECLIPSE_P2SITE_CONTENT_JAR
|
static java.lang.String |
ECLIPSE_UPDATESITE_FEATURES
|
static java.lang.String |
ECLIPSE_UPDATESITE_PLUGINS
|
static java.lang.String |
ECLIPSE_UPDATESITE_XML
|
Constructor Summary | |
---|---|
DownloadUtilities()
|
Method Summary | |
---|---|
static java.lang.String |
convertPathToWebServicesWAR(java.lang.String path)
Converts a Web-WAR path (relative to the server) to a WebServices-WAR path. |
static com.ibm.ram.internal.rest.RestContext |
createRequestContext(javax.servlet.http.HttpServletRequest request)
Create a new RestContext based on the incoming request. |
static com.ibm.ram.internal.rest.RequestStatus |
createRequestStatus(javax.servlet.http.HttpServletRequest request)
Create a RequestStatus from the incoming request. |
static java.lang.String |
downloadFile(javax.faces.context.FacesContext facesContext,
com.ibm.ram.common.util.InputStreamInformation isInfo,
java.lang.String fileName,
java.lang.String description)
|
static java.lang.String |
getArtifactURL(java.lang.String guid,
java.lang.String version,
java.lang.String path,
java.lang.String name,
boolean isSubmissionAsset,
boolean isPersisted)
Same as getArtifactURL(String, String, String, String, boolean, boolean, boolean) with preview link set to false . |
static java.lang.String |
getArtifactURL(java.lang.String guid,
java.lang.String version,
java.lang.String path,
java.lang.String name,
boolean isPersisted,
boolean isPreview,
boolean isSubmissionAsset)
Constructs a URL for the artifact with path and name in the asset with
guid and version . |
static java.lang.String |
getAssetURL(java.lang.String guid,
java.lang.String version,
boolean submission)
Get the URL for an asset |
static java.lang.String |
getRequestBase(javax.servlet.http.HttpServletRequest request)
Compute a Request base from servlet request. |
static java.net.URI |
getStorageAccessURI(java.lang.String uriFromClient)
|
static java.lang.String |
makeArtifactUrlsRelative(java.lang.String contents)
Make the Artifact URLs relative. |
static java.lang.String |
makeRelativeArtifactUrlsAbsolute(java.lang.String contents,
java.lang.String guid,
java.lang.String version)
Make the relative URLs ( src="artifacts/folder1/folder2/filename" ) to absolute for an asset being
displayed (src="http://serverpath/artifact/url-encoded-guid/url-encoded-version/folder1/folder2/filename" ). |
static java.lang.String |
makeRelativeArtifactUrlsUpdateAbsolute(java.lang.String contents,
java.lang.String submissionId)
Make the relative urls ( src="artifacts/folder1/folder2/filename" ) to absolute for an asset being
updated (src="http://serverpath/artifact/upload/folder1/folder2/filename" ). |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String ECLIPSE_UPDATESITE_XML
public static final java.lang.String ECLIPSE_P2SITE_ARTIFACTS_JAR
public static final java.lang.String ECLIPSE_P2SITE_CONTENT_JAR
public static final java.lang.String ECLIPSE_UPDATESITE_FEATURES
public static final java.lang.String ECLIPSE_UPDATESITE_PLUGINS
Constructor Detail |
---|
public DownloadUtilities()
Method Detail |
---|
public static java.lang.String getArtifactURL(java.lang.String guid, java.lang.String version, java.lang.String path, java.lang.String name, boolean isPersisted, boolean isPreview, boolean isSubmissionAsset)
path
and name
in the asset with
guid
and version
. If the asset has been submitted and is not being
modified, isPersisted
should be true
.
guid
- the GUID for the asset containing the artifact. If persist
is true
then this is GUID, if false
then this is submission ID.version
- the version for the asset containing the artifact. If persist
is true
then this is version, if false
then this is ignored.path
- the path within the asset to the artifactname
- the artifact nameisPersisted
- Use true
if this asset has already been submitted (i.e. the link is from the published asset content page).
In this case guid is the actual guid, and version is the actual version.
Use false
if this asset is in the submission phase (i.e. the link is for asset in the content page of submit asset). In this case
use SubmitAssetHandler.getSubmitId()
for guid and version will be ignored.isPreview
- true
if this should constructed as a preview link, or false
if constructed as a regular link.isSubmissionAsset
- true
if requesting artifact for a submission asset instead of the normal asset.
public static java.lang.String getAssetURL(java.lang.String guid, java.lang.String version, boolean submission)
guid
- version
- submission
-
public static java.lang.String getArtifactURL(java.lang.String guid, java.lang.String version, java.lang.String path, java.lang.String name, boolean isSubmissionAsset, boolean isPersisted)
getArtifactURL(String, String, String, String, boolean, boolean, boolean)
with preview link set to false
.
guid
- version
- path
- name
- isSubmissionAsset
- TODOisPersisted
-
public static java.net.URI getStorageAccessURI(java.lang.String uriFromClient)
public static java.lang.String downloadFile(javax.faces.context.FacesContext facesContext, com.ibm.ram.common.util.InputStreamInformation isInfo, java.lang.String fileName, java.lang.String description) throws java.io.IOException
java.io.IOException
public static java.lang.String makeArtifactUrlsRelative(java.lang.String contents)
makeRelativeArtifactUrlsUpdateAbsolute(String, String)
.
Note: This will use the current context path of the current faces request that the thread executing this method is under. This necessary because the links must be of the same context path so that they will be of the same session when they are clicked. If the server path was used and the server path is different than the context path then a new session would be needed for the link to executed.
contents
-
public static java.lang.String makeRelativeArtifactUrlsAbsolute(java.lang.String contents, java.lang.String guid, java.lang.String version)
src="artifacts/folder1/folder2/filename"
) to absolute for an asset being
displayed (src="http://serverpath/artifact/url-encoded-guid/url-encoded-version/folder1/folder2/filename"
).
This is used for display (not an asset being updated).
Note: This will use the current context path of the current faces request that the thread executing this method is under. This necessary because the links must be of the same context path so that they will be of the same session when they are clicked. If the server path was used and the server path is different than the context path then a new session would be needed for the link to executed.
contents
- the contents to convert.guid
- the guid (it is assumed to not by URL encoded). It will become encoded in the absolute URL.version
- the version (it is assumed to not by URL encoded). It will become encoded in the absolute URL.
public static java.lang.String makeRelativeArtifactUrlsUpdateAbsolute(java.lang.String contents, java.lang.String submissionId)
src="artifacts/folder1/folder2/filename"
) to absolute for an asset being
updated (src="http://serverpath/artifact/upload/folder1/folder2/filename"
).
Note: This will use the current context path of the current faces request that the thread executing this method is under. This necessary because the links must be of the same context path so that they will be of the same session when they are clicked. If the server path was used and the server path is different than the context path then a new session would be needed for the link to executed.
contents
- submissionId
- the submitId from the SubmitAssetHandler.
public static java.lang.String convertPathToWebServicesWAR(java.lang.String path)
Valid cases:
Invalid cases:
path
-
public static com.ibm.ram.internal.rest.RestContext createRequestContext(javax.servlet.http.HttpServletRequest request) throws java.net.URISyntaxException
RestContext
based on the incoming request.
request
- the incoming request
java.net.URISyntaxException
public static com.ibm.ram.internal.rest.RequestStatus createRequestStatus(javax.servlet.http.HttpServletRequest request)
RequestStatus
from the incoming request.
request
- the incoming request.
public static java.lang.String getRequestBase(javax.servlet.http.HttpServletRequest request)
RestContext
.
request
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |