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
.
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
Fields inherited from class eu.bandm.tools.util.files.SourceHabitats.SourceHabitat
name, ok
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected @Opt SourceHabitats.FoundSource
test_idExt
(String id, BiConsumer<String, Object[]> verb, String ext) Finds the resource with the given name.Methods inherited from class eu.bandm.tools.util.files.SourceHabitats.SourceHabitat
test_for_inputStream
-
Field Details
-
cls
==null only in case of error. -
reldir
-
-
Constructor Details
-
SourceHabitat_resource
-
-
Method Details
-
test_idExt
@Opt protected @Opt SourceHabitats.FoundSource test_idExt(String id, BiConsumer<String, Object[]> verb, String ext) Description copied from class:SourceHabitats.SourceHabitat
Finds the resource with the given name. This must be implemented differently for different kinds of Habitats.- Specified by:
test_idExt
in classSourceHabitats.SourceHabitat
- Parameters:
id
- name of the resource (mostly the file name "stem")ext
- extension of the resource name / file name. The leading dot (=".") must be included.- Returns:
- the found resource or null if no such exists.
-