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)
ServerRepository
UploadedArtifact
and returns a repository managed artifact.saveContents
in interface ServerRepository
uploadedArtifact
- UploadedArtifact
received by from the upload request.public ManagedArtifact getArtifact(String pathInfo)
ServerRepository
getArtifact
in interface ServerRepository
pathInfo
- Path to artifact received in the HTTP request.ArtifactDownloadException
.public Class<? extends ManagedArtifact> getConfiguredManagedArtifactClass()
ServerRepository
ManagedArtifact
classgetConfiguredManagedArtifactClass
in interface ServerRepository
ManagedArtifact
class that the ServerRepository
is managingpublic File getRepositoryFolder()
ServerRepository
getRepositoryFolder
in interface ServerRepository
File
Copyright © 2016 PayPal Open Source. All rights reserved.