public class TemplateScavengerImpl extends AbstractResourceScavenger<TemplateProject> implements TemplateScavenger
DEFAULT_RESOURCE_ID
Constructor and Description |
---|
TemplateScavengerImpl(File scavengeLocation)
Create a template project scavenger.
|
Modifier and Type | Method and Description |
---|---|
void |
forceUpdate(String templateId)
Force an update of the template with the given ID, resetting already
loaded information.
|
protected TemplateProject |
loadReference(File resourceFolder,
String resourceFileName,
String resourceId)
Load a resource reference.
|
protected void |
onAdd(TemplateProject reference,
String resourceId)
Called when a resource has been added, either when adding the resource on
the first scan or if it was added afterwards.
|
protected void |
onRemove(TemplateProject reference,
String resourceId)
Called when a resource has been removed.
|
void |
triggerScan()
Check if there are any new projects available.
|
protected void |
updateResource(TemplateProject reference,
String resourceId)
Called when an existing resource is visited during a scan.
|
allowAddResource, deleteResource, getHuntingGrounds, getReference, getResources, releaseResourceId, reserveResource, reserveResourceId
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
allowAddResource, deleteResource, getHuntingGrounds, getReference, getResources, releaseResourceId, reserveResource, reserveResourceId
public TemplateScavengerImpl(File scavengeLocation)
scavengeLocation
- the location to scan, if the location does not
exist or is not accessible, a default location inside the
platform instance location is usedprotected void onRemove(TemplateProject reference, String resourceId)
AbstractResourceScavenger
onRemove
in class AbstractResourceScavenger<TemplateProject>
reference
- the resource referenceresourceId
- the resource identifierprotected TemplateProject loadReference(File resourceFolder, String resourceFileName, String resourceId) throws IOException
AbstractResourceScavenger
loadReference
in class AbstractResourceScavenger<TemplateProject>
resourceFolder
- the resource folderresourceFileName
- the name of the resource file in that folder, may
be null
if unknownresourceId
- the resource identifierIOException
- if the resource cannot be accessed or loadedpublic void triggerScan()
ResourceScavenger
triggerScan
in interface ResourceScavenger<TemplateProject>
triggerScan
in class AbstractResourceScavenger<TemplateProject>
ResourceScavenger.triggerScan()
protected void onAdd(TemplateProject reference, String resourceId)
AbstractResourceScavenger
onAdd
in class AbstractResourceScavenger<TemplateProject>
reference
- the resource referenceresourceId
- the resource identifierpublic void forceUpdate(String templateId)
TemplateScavenger
forceUpdate
in interface TemplateScavenger
templateId
- the template identifierprotected void updateResource(TemplateProject reference, String resourceId)
AbstractResourceScavenger
updateResource
in class AbstractResourceScavenger<TemplateProject>
reference
- the resource reference to updateresourceId
- the resource identifierBuild 2013-10-07_11-27-38
Revision 99b27713a799a59a21b0b166eaaea8aaefbf125a