public class ManagedArtifactRepository extends Object implements ServerRepository
ManagedArtifactRepository is an implementation of ServerRepository for ManagedArtifact.
The class is essentially a Singleton pattern. The class implements a Timer task that
will run a cleaner thread that runs every hour to clean the artifacts inside the repository folder. All artifacts
that have ManagedArtifact.isExpired() returning true are considered for removal during the cleaning cycle.| Modifier and Type | Method and Description |
|---|---|
ManagedArtifact |
getArtifact(String pathInfo)
Returns the artifact if there is a matching artifact for the requested artifact.
|
Class<? extends ManagedArtifact> |
getConfiguredManagedArtifactClass()
Returns the configured
ManagedArtifact class |
static ManagedArtifactRepository |
getInstance() |
File |
getRepositoryFolder()
Returns the repository folder
|
ManagedArtifact |
saveContents(UploadedArtifact uploadedArtifact)
Saves the
UploadedArtifact and returns a repository managed artifact. |
public static ManagedArtifactRepository getInstance()
public ManagedArtifact saveContents(UploadedArtifact uploadedArtifact)
ServerRepositoryUploadedArtifact and returns a repository managed artifact.saveContents in interface ServerRepositoryuploadedArtifact - UploadedArtifact received by from the upload request.public ManagedArtifact getArtifact(String pathInfo)
ServerRepositorygetArtifact in interface ServerRepositorypathInfo - Path to artifact received in the HTTP request.ArtifactDownloadException.public Class<? extends ManagedArtifact> getConfiguredManagedArtifactClass()
ServerRepositoryManagedArtifact classgetConfiguredManagedArtifactClass in interface ServerRepositoryManagedArtifact class that the ServerRepository is managingpublic File getRepositoryFolder()
ServerRepositorygetRepositoryFolder in interface ServerRepositoryFileCopyright © 2016 PayPal Open Source. All rights reserved.