Package com.atlassian.plugin.loaders
Class DirectoryScanner
java.lang.Object
com.atlassian.plugin.loaders.DirectoryScanner
- All Implemented Interfaces:
Scanner
Scans the filesystem for changed or added plugin files and stores a map of the currently known ones. Files beginning
with "." are ignored.
- Since:
- 2.1.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidTells the Scanner to forget about a file it has loaded so that it will reload it next time it scans.Retrieve all theDeploymentUnits currently stored.locateDeploymentUnit(File file) Given a file, finds the deployment unit for it if one has already been scanned.voidremove(DeploymentUnit unit) Remove the specified deployment unit in such a way as it will not be picked up by subsequent scans, even if the system is restarted.voidreset()Clears the list of scanned deployment units.scan()Scans for all files and directories that have been added or modified since the last call to scan.
-
Constructor Details
-
DirectoryScanner
Constructor for scanner.- Parameters:
pluginsDirectory- the directory that the scanner should monitor for plugins
-
-
Method Details
-
locateDeploymentUnit
Given a file, finds the deployment unit for it if one has already been scanned.- Parameters:
file- a jar file.- Returns:
- the stored deploymentUnit matching the file or null if none exists.
-
clear
Tells the Scanner to forget about a file it has loaded so that it will reload it next time it scans.- Parameters:
file- a file that may have already been scanned.
-
scan
Scans for all files and directories that have been added or modified since the last call to scan. This will ignore all files or directories starting with the '.' character.- Specified by:
scanin interfaceScanner- Returns:
- Collection of
DeploymentUnits that describe newly added files or directories.
-
getDeploymentUnits
Retrieve all theDeploymentUnits currently stored.- Specified by:
getDeploymentUnitsin interfaceScanner- Returns:
- the complete unmodifiable list of scanned
DeploymentUnits.
-
reset
public void reset()Clears the list of scanned deployment units. -
remove
Description copied from interface:ScannerRemove the specified deployment unit in such a way as it will not be picked up by subsequent scans, even if the system is restarted.
-