Package dk.netarkivet.common.utils.cdx
Class CDXReader
- java.lang.Object
-
- dk.netarkivet.common.utils.cdx.CDXReader
-
public class CDXReader extends Object
This class handles reading CDX files and finding entries in them. Furthermore it implements the possibility to do filtering of searchresults
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addCDXFile(File cdxFile)
Add another CDX file to those being searched.void
addCDXRecordFilter(CDXRecordFilter cdxrecfilter)
Add another CDXRecordFilter to the list of filters to use when searching.void
clearCDXFiles()
Forget about all CDX files.CDXRecordFilter
getCDXRecordFilter(String filtername)
Get a specific filter by the name of the filter - if not found return null.Map<String,CDXRecordFilter>
getFilters()
Get a table of all filters.ARCKey
getKey(String uri)
Look up an entry in CDX files.void
removeAllCDXRecordFilters()
Remove all CDXRecordFilters.void
removeCDXRecordFilter(String filtername)
Remove a specific filter by the name of the filter.
-
-
-
Method Detail
-
addCDXFile
public void addCDXFile(File cdxFile)
Add another CDX file to those being searched.- Parameters:
cdxFile
- A CDX file to search.- Throws:
IOFailure
- If the file cannot be found or read
-
clearCDXFiles
public void clearCDXFiles()
Forget about all CDX files.
-
addCDXRecordFilter
public void addCDXRecordFilter(CDXRecordFilter cdxrecfilter) throws ArgumentNotValid
Add another CDXRecordFilter to the list of filters to use when searching.- Parameters:
cdxrecfilter
- A CDXRecordFilter to use when searching.- Throws:
ArgumentNotValid
- If the filter is invalid or another filter exists with the same name.
-
removeAllCDXRecordFilters
public void removeAllCDXRecordFilters()
Remove all CDXRecordFilters.
-
getFilters
public Map<String,CDXRecordFilter> getFilters()
Get a table of all filters.- Returns:
- a Hashtable with all the filters.
-
getCDXRecordFilter
public CDXRecordFilter getCDXRecordFilter(String filtername)
Get a specific filter by the name of the filter - if not found return null.- Parameters:
filtername
- The given filtername.- Returns:
- the CDXRecordFilter
-
removeCDXRecordFilter
public void removeCDXRecordFilter(String filtername)
Remove a specific filter by the name of the filter.- Parameters:
filtername
- The given filtername.- Throws:
UnknownID
- if there is no filter of that name.
-
-