Package com.atlassian.plugin.loaders
Class RosterFileScanner
java.lang.Object
com.atlassian.plugin.loaders.RosterFileScanner
- All Implemented Interfaces:
Scanner
A Scanner which polls a file containing a list of file names to define its content.
- Since:
- 3.0.24
-
Constructor Summary
ConstructorsConstructorDescriptionRosterFileScanner(File rosterFile) Create a roster file scanner which loads the given roster file to locate plugins. -
Method Summary
Modifier and TypeMethodDescriptionGets all deployment units currently being tracked by the scanner.static StringThe suffix for a roster file containing a simple plugin list.static booleanisKnownRosterFileFormat(File rosterFile) Check whether a proposed roster file is in a known format.voidremove(DeploymentUnit deploymentUnit) 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()Reset the scanner.scan()Scan for new deployment units.
-
Constructor Details
-
RosterFileScanner
Create a roster file scanner which loads the given roster file to locate plugins.The provided roster file format is determined by its file suffix. Currently supported suffixes are -
getListSuffix(): a list of file paths, one per line If the format is not recognized, anIllegalArgumentExceptionis thrown. This can be checked before construction usingisKnownRosterFileFormat(File).- Parameters:
rosterFile- the file to load the plugin roster from.- Throws:
IllegalArgumentException- if the suffix of rosterFile is not a supported file format
-
-
Method Details
-
scan
Description copied from interface:ScannerScan for new deployment units. On the first scan, all deployment units that the scanner can find will be returned. Subsequent scans will only return deployment units that are new since the last scan (or call to reset() or clear()) -
getDeploymentUnits
Description copied from interface:ScannerGets all deployment units currently being tracked by the scanner. This will not trigger a scan, meaning that plugins that have been added since the last scan will not be returned.- Specified by:
getDeploymentUnitsin interfaceScanner- Returns:
- a collection of all deployment units currently being tracked by the scanner.
-
reset
public void reset()Description copied from interface:ScannerReset the scanner. This causes it to forget all state about which plugins have (or haven't) been loaded. -
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. -
getListSuffix
The suffix for a roster file containing a simple plugin list.Roster files with this suffix have one literal path per line. Relative paths are resolved relative to the directory containing the list file. Entries are considered distinct or not based on the path used in the file - no canonicalization is forced.
- Returns:
- the suffix used for roster files containing just a list of plugin jar files.
-
isKnownRosterFileFormat
Check whether a proposed roster file is in a known format.- Parameters:
rosterFile- the roster file to check.- Returns:
- true if the format of the roster file is known.
- See Also:
-