Class AbstractTraversableSourceEnumerator
java.lang.Object
org.ametys.plugins.core.impl.enumerator.AbstractTraversableSourceEnumerator
- All Implemented Interfaces:
Enumerator<String>
,Serviceable
- Direct Known Subclasses:
ExtractionDefinitionFilesEnumerator
,ExtractionResultFilesEnumerator
public abstract class AbstractTraversableSourceEnumerator
extends Object
implements Enumerator<String>, Serviceable
An enumeration that list will list all the file in a source recursively.
Source inside a collection will be listed as "path/to/filename"
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
acceptSource
(TraversableSource source) Specify if a source should be included in the result.Retrieves a single label from a value.protected abstract String
Provide the location of the Source to extract the content fromProvides the enumerated values with their optional label.void
service
(ServiceManager manager) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.ametys.runtime.model.Enumerator
getConfiguration
-
Constructor Details
-
AbstractTraversableSourceEnumerator
public AbstractTraversableSourceEnumerator()
-
-
Method Details
-
service
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
getTypedEntries
Description copied from interface:Enumerator
Provides the enumerated values with their optional label.- Specified by:
getTypedEntries
in interfaceEnumerator<String>
- Returns:
- the enumerated values and their label.
- Throws:
MalformedURLException
IOException
-
getLocation
Provide the location of the Source to extract the content from- Returns:
- the location of the source
-
acceptSource
Specify if a source should be included in the result.- Parameters:
source
- the Source to test- Returns:
- true if the source should be included, false otherwise
-
getEntry
Description copied from interface:Enumerator
Retrieves a single label from a value.- Specified by:
getEntry
in interfaceEnumerator<String>
- Parameters:
value
- the value.- Returns:
- the label or
null
if not found. - Throws:
Exception
- if an error occurs.
-