public class DefaultManagedArtifact extends Object implements ManagedArtifact
DefaultManagedArtifact represents an artifact that is successfully saved to SeLion grid by an HTTP POST
method call. This artifact mostly represents binary file types rather than text files. The MIME type for this
artifact is set to 'application/zip'. Expiration of the artifact is based on TTL (Time To Live) specified in
milliseconds The configuration is read from Grid configuration system.ManagedArtifact.RequestParametersARTIFACT_FILE_NAME, ARTIFACT_FOLDER_NAME| Constructor and Description |
|---|
DefaultManagedArtifact() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object other) |
String |
getAbsolutePath()
Return the path of the artifact file
|
byte[] |
getArtifactContents()
Returns the contents of the artifact as a byte array.
|
String |
getArtifactName()
Returns the artifact name.
|
String |
getHttpContentType()
Returns the MIME content type for this
ManagedArtifact |
<T extends ManagedArtifact.RequestParameters> |
getRequestParameters()
Returns the headers associated with this
ManagedArtifact |
int |
hashCode() |
void |
initFromPath(String absolutePath)
Initialize the artifact by it's file path.
|
void |
initFromUploadedArtifact(UploadedArtifact uploaded)
Initialize the artifact by an in-bound uploaded artifact
|
boolean |
isExpired()
Returns true if this
ManagedArtifact has expired. |
boolean |
matchesPathInfo(String pathInfo)
Matches the artifact based on some path info.
|
String |
toString() |
public <T extends ManagedArtifact.RequestParameters> T getRequestParameters()
ManagedArtifactManagedArtifactgetRequestParameters in interface ManagedArtifactManagedArtifact.RequestParameterspublic void initFromPath(String absolutePath)
ManagedArtifactinitFromPath in interface ManagedArtifactabsolutePath - absolute path to the artifact. Must be in the ServerRepository path. For example:
/{serverRepository}/{artifactFolder}/{artifactName}public void initFromUploadedArtifact(UploadedArtifact uploaded)
ManagedArtifactinitFromUploadedArtifact in interface ManagedArtifactuploaded - instance of UploadedArtifact which will contain the meta-info for the uploaded artifactpublic String getArtifactName()
ManagedArtifactgetArtifactName in interface ManagedArtifactpublic byte[] getArtifactContents()
ManagedArtifactDownloadRespondergetArtifactContents in interface ManagedArtifactpublic boolean matchesPathInfo(String pathInfo)
ManagedArtifactServerRepository to find artifacts by a
relative, publicly exposed (via the download URL), pathmatchesPathInfo in interface ManagedArtifactpathInfo - String path information to match against. For example:
/{artifactFolder}/{artifactName}public boolean isExpired()
ManagedArtifactManagedArtifact has expired. Called by the ServerRepository to clean up
artifacts.isExpired in interface ManagedArtifactpublic String getHttpContentType()
ManagedArtifactManagedArtifactgetHttpContentType in interface ManagedArtifactpublic String getAbsolutePath()
ManagedArtifactgetAbsolutePath in interface ManagedArtifactServerRepository path. For example:
/{serverRepository}/{artifactFolder}/{artifactName}Copyright © 2016 PayPal Open Source. All rights reserved.