Package eu.bandm.tools.util2
Class SourceHabitats
java.lang.Object
eu.bandm.tools.util2.SourceHabitats
Organizes a collection of places where to look for resources (=input files).
A sequence of
FIXME: A URL style href search should be added!
A sequence of
SourceHabitats.SourceHabitat
is maintained which will
be searched for a file, ie. a data source with a certain file name.
Currently this can be a SourceHabitats.SourceHabitat_file
as a pointer
into the file system, or a SourceHabitats.SourceHabitat_resource
as a class
which cames with "resources", eg. in a ".jar" file.
FIXME: A URL style href search should be added!
-
Nested Class Summary
Modifier and TypeClassDescriptionclass
Represents the only one data source which has been successfully found for one particular resource name (mostly a "file name stem").class
Represents one of many potential sources which have to be searched for library modules, etc.protected class
Represents a source habitat which is a directory in the file system.protected class
Represents a source habitat which points to a directory, relative to the position of a loaded java class. -
Field Summary
Modifier and TypeFieldDescriptionprotected MessageReceiver<SimpleMessage<XMLDocumentIdentifier>>
static final String
static final String
static final String
protected static Function<SourceHabitats.SourceHabitat,
String> protected List<SourceHabitats.SourceHabitat>
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
appendNewHabitat
(String s, @Opt String additionalErrorText) Service access point for adding a habitat to the end of the search list.protected void
protected void
protected @Opt SourceHabitats.SourceHabitat
makeHabitat
(String name, @Opt String additionalErrorText) Internal method to check whether the input toappendNewHabitat(String,String)
is consistent.searchAllPlaces
(String name, boolean verbose, String... suffices) Service access point for searching all habitats, for the name of the resources, tested with all suffixed.
-
Field Details
-
PREFIX_FILE
- See Also:
-
PREFIX_RESOURCE
- See Also:
-
RELATIVE_PATH_SEPARATOR
- See Also:
-
msg
-
sourceList
-
SourceHabitat_get_name
-
-
Constructor Details
-
SourceHabitats
-
-
Method Details
-
allPlaces_toString
-
searchAllPlaces
@Opt public @Opt SourceHabitats.FoundSource searchAllPlaces(String name, boolean verbose, String... suffices) Service access point for searching all habitats, for the name of the resources, tested with all suffixed. The suffixes are tested faster, i.e.all are tested per habitat in the sequential order of the argument. The suffixes must include a leading dot (="."), but can also be totally empty. -
appendNewHabitat
Service access point for adding a habitat to the end of the search list. Does so only if consistency checks okay.- Parameters:
s
- name of the habitat according to the defined prefices, see class docu text.additionalErrorText
- describes the context of the habitat modification attempt
-
ERROR
-
LOG
-
makeHabitat
@Opt protected @Opt SourceHabitats.SourceHabitat makeHabitat(String name, @Opt @Opt String additionalErrorText) Internal method to check whether the input toappendNewHabitat(String,String)
is consistent.- Parameters:
additionalErrorText
- describes the context of the habitat modification attempt
-