public static class DocumentCollection.CollectionFile extends Object implements Comparable<DocumentCollection.CollectionFile>
Modifier and Type | Field and Description |
---|---|
protected int |
collectionFileNumber
Each collection file has a number, and optionally a suffix.
|
protected int |
documentCount
The number of documents contained.
|
protected File |
file |
static FilenameFilter |
FILENAME_FILTER |
protected long |
firstEntry |
protected long |
lastEntry |
protected long |
length
The size in bytes of the underlying file.
|
static String |
MIMIR_COLLECTION_BASENAME
The filename for the zip collection.
|
static String |
MIMIR_COLLECTION_EXTENSION
The file extension used for the mimir-specific relocatable zip collection
definition.
|
protected static Pattern |
MIMIR_COLLECTION_PATTERN
Regex pattern that recognises a valid collection file name and its parts.
|
protected ZipFile |
zipFile |
Constructor and Description |
---|
CollectionFile(File file) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
int |
compareTo(DocumentCollection.CollectionFile o) |
boolean |
containsDocument(long documentID) |
protected static String |
getCollectionFileId(String fileName)
Given the name of a zip file, this method returns its ID: the part of the
file name between the prefix () and
the suffix (), or
null if
the name is not that of a valid collection file. |
static String |
getCollectionFileName(String id) |
protected static int |
getCollectionFileNumber(String fileName) |
DocumentData |
getDocumentData(Long documentID) |
public static final String MIMIR_COLLECTION_BASENAME
public static final String MIMIR_COLLECTION_EXTENSION
protected static final Pattern MIMIR_COLLECTION_PATTERN
public static FilenameFilter FILENAME_FILTER
protected File file
protected ZipFile zipFile
protected long firstEntry
protected long lastEntry
protected int collectionFileNumber
protected long length
protected int documentCount
public CollectionFile(File file) throws ZipException, IOException
ZipException
IOException
protected static String getCollectionFileId(String fileName)
null
if
the name is not that of a valid collection file.fileName
- the file name to be parsed.null
.protected static int getCollectionFileNumber(String fileName)
public int compareTo(DocumentCollection.CollectionFile o)
compareTo
in interface Comparable<DocumentCollection.CollectionFile>
public boolean containsDocument(long documentID)
public DocumentData getDocumentData(Long documentID) throws IOException
IOException
public void close() throws IOException
IOException
Copyright © 2021 GATE. All rights reserved.