Package digilib.meta
Class IndexMetaAuthLoader
java.lang.Object
digilib.meta.IndexMetaAuthLoader
Class loading index.meta files extracting image file related information.
Extracts into the MetadataMap all tags in the meta/img tag as key-value
pairs and information from the meta/access tag under the "access" key.
<meta>
<img>
<original-dpi>600</original-dpi>
</img>
<access-conditions>
<access type="group">
<name>digigroup</name>
</access>
</access-conditions>
</meta>
Returns a map with filenames and MetadataMaps with directory-wide information
under the key "":
{ "pageimg/page140r.jpg" : {"original-dpi" : 300} "" : { "access" : "group:digigroup", "original-dpi" : 600}, }Implemented using javax.xml.stream.XMLStreamReader.
- Author:
- Robert Casties
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionLoad and parse a file (as URI).protected MetadataMap
Reads access tag into map.protected boolean
readAll()
Read the whole stream.protected MetadataMap
readMetaTag
(MetadataMap map) Read meta tag into map.protected MetadataMap
readTagToMap
(MetadataMap map) Reads contents of current tag into map with the tag name as key and the content as value.protected boolean
tagsMatchPath
(String[] path) Returns if the tag names in path match the current stack of tag names in tags.
-
Field Details
-
logger
protected static final org.slf4j.Logger logger -
metaTag
-
fileTag
-
fileNamePath
-
filePathPath
-
fileMetaPath
-
imgTag
-
accessTag
-
accessPath
-
accessNamePath
-
files
-
-
Constructor Details
-
IndexMetaAuthLoader
public IndexMetaAuthLoader()
-
-
Method Details
-
tagsMatchPath
Returns if the tag names in path match the current stack of tag names in tags.- Parameters:
path
- the path- Returns:
- tags match path
-
readAll
Read the whole stream.- Returns:
- false
- Throws:
XMLStreamException
- on error
-
readTagToMap
Reads contents of current tag into map with the tag name as key and the content as value.- Parameters:
map
- the MetadataMap- Returns:
- the MetadataMap
- Throws:
XMLStreamException
- on error
-
readAccessToMap
Reads access tag into map.- Parameters:
map
- the MetadataMap- Returns:
- the MetadataMap
- Throws:
XMLStreamException
- on error
-
readMetaTag
Read meta tag into map.- Parameters:
map
- the MetadataMap- Returns:
- the MetadataMap
- Throws:
XMLStreamException
- on error
-
loadUri
Load and parse a file (as URI). returns HashMap with list data- Parameters:
uri
- the URI- Returns:
- the metadata
- Throws:
IOException
- on error
-