public abstract class AbstractFreedesktopService<T extends FreedesktopEntity> extends Object implements FreedesktopService<T>
FreedesktopService that provides
methods for maintaining the list of base directories (common to all
specifications).| Modifier and Type | Field and Description |
|---|---|
protected Map<org.apache.commons.vfs2.FileObject,Collection<T>> |
bases |
protected List<org.apache.commons.vfs2.FileObject> |
basesList |
| Constructor and Description |
|---|
AbstractFreedesktopService() |
| Modifier and Type | Method and Description |
|---|---|
void |
addBase(org.apache.commons.vfs2.FileObject base)
Add a directory to the list of those that should be searched.
|
protected void |
checkAndAddBase(File file) |
protected void |
checkAndAddBase(org.apache.commons.vfs2.FileObject file) |
Collection<T> |
getAllEntities()
Get a collection of all available entities in all bases.
|
Collection<org.apache.commons.vfs2.FileObject> |
getBases()
Get a collection of all base directories.
|
Collection<org.apache.commons.vfs2.FileObject> |
getBasesInReverse() |
Collection<T> |
getEntities(org.apache.commons.vfs2.FileObject base)
Get a collection of all available entities in the specified base directory.
|
T |
getEntity(String name)
Get a entities given its name.
|
protected org.apache.commons.vfs2.FileObject[] |
listDirs(org.apache.commons.vfs2.FileObject dir) |
void |
removeBase(org.apache.commons.vfs2.FileObject base)
Remove a directory from the list that is is searched.
|
protected abstract Collection<T> |
scanBase(org.apache.commons.vfs2.FileObject base) |
protected Map<org.apache.commons.vfs2.FileObject,Collection<T extends FreedesktopEntity>> bases
protected List<org.apache.commons.vfs2.FileObject> basesList
public void addBase(org.apache.commons.vfs2.FileObject base)
throws IOException
FreedesktopServiceaddBase in interface FreedesktopService<T extends FreedesktopEntity>base - base directoryIOException - if location is invalid in some waypublic void removeBase(org.apache.commons.vfs2.FileObject base)
FreedesktopServiceremoveBase in interface FreedesktopService<T extends FreedesktopEntity>base - base directory to remove from the list that is searched#addBase(File)public Collection<T> getEntities(org.apache.commons.vfs2.FileObject base)
FreedesktopServicegetEntities in interface FreedesktopService<T extends FreedesktopEntity>base - base directorypublic Collection<T> getAllEntities()
FreedesktopServicegetAllEntities in interface FreedesktopService<T extends FreedesktopEntity>public T getEntity(String name)
FreedesktopServicegetEntity in interface FreedesktopService<T extends FreedesktopEntity>name - internal name of entitiespublic Collection<org.apache.commons.vfs2.FileObject> getBases()
FreedesktopServicegetBases in interface FreedesktopService<T extends FreedesktopEntity>public Collection<org.apache.commons.vfs2.FileObject> getBasesInReverse()
protected void checkAndAddBase(org.apache.commons.vfs2.FileObject file)
throws IOException,
ParseException
IOExceptionParseExceptionprotected void checkAndAddBase(File file) throws IOException, ParseException
IOExceptionParseExceptionprotected org.apache.commons.vfs2.FileObject[] listDirs(org.apache.commons.vfs2.FileObject dir)
throws IOException
IOExceptionprotected abstract Collection<T> scanBase(org.apache.commons.vfs2.FileObject base) throws IOException
IOExceptionCopyright © 2016. All rights reserved.