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
Constructors Constructor Description AbstractTraversableSourceEnumerator()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected boolean
acceptSource(TraversableSource source)
Specify if a source should be included in the result.I18nizableText
getEntry(String value)
Retrieves a single label from a value.protected abstract String
getLocation()
Provide the location of the Source to extract the content fromMap<String,I18nizableText>
getTypedEntries()
Provides 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 Detail
-
AbstractTraversableSourceEnumerator
public AbstractTraversableSourceEnumerator()
-
-
Method Detail
-
service
public void service(ServiceManager manager) throws ServiceException
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
getTypedEntries
public Map<String,I18nizableText> getTypedEntries() throws MalformedURLException, IOException
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
protected abstract String getLocation()
Provide the location of the Source to extract the content from- Returns:
- the location of the source
-
acceptSource
protected boolean acceptSource(TraversableSource source)
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
public I18nizableText getEntry(String value) throws Exception
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.
-
-