Package eu.bandm.tools.util.files
Class SourceHabitats.SourceHabitat_resource
java.lang.Object
eu.bandm.tools.util.files.SourceHabitats.SourceHabitat
eu.bandm.tools.util.files.SourceHabitats.SourceHabitat_resource
- Enclosing class:
SourceHabitats
Represents a source habitat which points to a directory, relative to the
position of a loaded java class.
So the name must be like
a.b.c or a.b.c/d/e,
see SourceHabitats.SourceHabitat.
All resources searched for must be files existing relative to the point
where the class has been loaded from (e.g. file system, or a ".jar" file)
and this accessible by
Class.getResourceAsStream(String) or sim.-
Field Summary
FieldsModifier and TypeFieldDescriptionStartpoint of the resources represented by this habitat.protected final StringDirectory relative toclswhich serves as startpoint for searchign resources.Fields inherited from class eu.bandm.tools.util.files.SourceHabitats.SourceHabitat
name, ok -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected @Opt SourceHabitats.FoundSourcetest_idExt(String id, BiConsumer<String, Object[]> verbose, String ext) Searches for the resource with the given name and suffix.Methods inherited from class eu.bandm.tools.util.files.SourceHabitats.SourceHabitat
test_for_inputStream
-
Field Details
-
cls
Startpoint of the resources represented by this habitat. ==null only in case of error. -
reldir
Directory relative toclswhich serves as startpoint for searchign resources.
-
-
Constructor Details
-
SourceHabitat_resource
Only constructor.- Parameters:
name- defines the start point where to look for sources, seeSourceHabitats.SourceHabitat.
-
-
Method Details
-
test_idExt
@Opt protected @Opt SourceHabitats.FoundSource test_idExt(String id, BiConsumer<String, Object[]> verbose, String ext) Description copied from class:SourceHabitats.SourceHabitatSearches for the resource with the given name and suffix. This must be implemented differently for different kinds of Habitats. Fills in the found stream and "location" into the aSourceHabitats.FoundSourceobject.- Specified by:
test_idExtin classSourceHabitats.SourceHabitat- Parameters:
id- name of the resource searched forverbose- the target of log messagesext- extension of the resource name / file name. It must include the leading dot (=".") or be completely empty.- Returns:
- the found resource or null if no such exists.
-