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.RequestParameters
ARTIFACT_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()
ManagedArtifact
ManagedArtifact
getRequestParameters
in interface ManagedArtifact
ManagedArtifact.RequestParameters
public void initFromPath(String absolutePath)
ManagedArtifact
initFromPath
in interface ManagedArtifact
absolutePath
- absolute path to the artifact. Must be in the ServerRepository
path. For example:
/{serverRepository}/{artifactFolder}/{artifactName}
public void initFromUploadedArtifact(UploadedArtifact uploaded)
ManagedArtifact
initFromUploadedArtifact
in interface ManagedArtifact
uploaded
- instance of UploadedArtifact
which will contain the meta-info for the uploaded artifactpublic String getArtifactName()
ManagedArtifact
getArtifactName
in interface ManagedArtifact
public byte[] getArtifactContents()
ManagedArtifact
DownloadResponder
getArtifactContents
in interface ManagedArtifact
public boolean matchesPathInfo(String pathInfo)
ManagedArtifact
ServerRepository
to find artifacts by a
relative, publicly exposed (via the download URL), pathmatchesPathInfo
in interface ManagedArtifact
pathInfo
- String
path information to match against. For example:
/{artifactFolder}/{artifactName}
public boolean isExpired()
ManagedArtifact
ManagedArtifact
has expired. Called by the ServerRepository
to clean up
artifacts.isExpired
in interface ManagedArtifact
public String getHttpContentType()
ManagedArtifact
ManagedArtifact
getHttpContentType
in interface ManagedArtifact
public String getAbsolutePath()
ManagedArtifact
getAbsolutePath
in interface ManagedArtifact
ServerRepository
path. For example:
/{serverRepository}/{artifactFolder}/{artifactName}
Copyright © 2016 PayPal Open Source. All rights reserved.