MwDumpFileJsonOnlineDumpFile, WmfLocalDumpFile, WmfOnlineStandardDumpFilepublic abstract class WmfDumpFile extends java.lang.Object implements MwDumpFile
MwDumpFile.DateComparator| Modifier and Type | Field | Description |
|---|---|---|
protected java.lang.String |
dateStamp |
|
protected static java.lang.String |
DUMP_SITE_BASE_URL |
The default URL of the website to obtain the dump files from.
|
protected java.lang.String |
projectName |
| Constructor | Description |
|---|---|
WmfDumpFile(java.lang.String dateStamp,
java.lang.String projectName) |
| Modifier and Type | Method | Description |
|---|---|---|
protected abstract boolean |
fetchIsDone() |
Finds out if the dump is ready.
|
java.lang.String |
getDateStamp() |
Returns the date stamp for this dump.
|
static java.lang.String |
getDateStampFromDumpFileDirectoryName(DumpContentType dumpContentType,
java.lang.String directoryName) |
Extracts the date stamp from a dumpfile directory name in the form that
is created by
getDumpFileDirectoryName(DumpContentType, String). |
static org.wikidata.wdtk.util.CompressionType |
getDumpFileCompressionType(java.lang.String fileName) |
Returns the compression type of this kind of dump file using file suffixes
|
static java.lang.String |
getDumpFileDirectoryName(DumpContentType dumpContentType,
java.lang.String dateStamp) |
Returns the name of the directory where the dumpfile of the given type
and date should be stored.
|
static java.lang.String |
getDumpFileName(DumpContentType dumpContentType,
java.lang.String projectName,
java.lang.String dateStamp) |
Returns the name under which this dump file.
|
static java.lang.String |
getDumpFilePostfix(DumpContentType dumpContentType) |
Returns the ending used by the Wikimedia-provided dumpfile names of the
given type.
|
java.io.BufferedReader |
getDumpFileReader() |
Returns a buffered reader that provides access to the (uncompressed) text
content of the dump file.
|
static java.lang.String |
getDumpFileWebDirectory(DumpContentType dumpContentType,
java.lang.String projectName) |
Returns the absolute directory on the Web site where dumpfiles of the
given type can be found.
|
java.lang.String |
getProjectName() |
Returns the project name for this dump.
|
boolean |
isAvailable() |
Checks if the dump is actually available.
|
static boolean |
isRevisionDumpFile(DumpContentType dumpContentType) |
Returns true if the given dump file type contains page revisions and
false if it does not.
|
java.lang.String |
toString() |
getDumpContentType, getDumpFileStream, prepareDumpFileprotected static final java.lang.String DUMP_SITE_BASE_URL
protected final java.lang.String dateStamp
protected final java.lang.String projectName
public WmfDumpFile(java.lang.String dateStamp,
java.lang.String projectName)
public java.lang.String getProjectName()
MwDumpFilegetProjectName in interface MwDumpFilepublic java.lang.String getDateStamp()
MwDumpFilegetDateStamp in interface MwDumpFilepublic boolean isAvailable()
MwDumpFileMwDumpFile.getDumpFileReader(). Depending on the type of dumpfile, this
will trigger one or more checks to make sure that all relevant data can
be accessed for this dump file. This is still no definite guarantee that
the download will succeed, since there can always be IO errors anyway,
but it helps to detect cases where the dump is clearly not in a usable
state.isAvailable in interface MwDumpFilepublic java.lang.String toString()
toString in class java.lang.Objectpublic java.io.BufferedReader getDumpFileReader()
throws java.io.IOException
MwDumpFileIt is important to close the reader after use.
getDumpFileReader in interface MwDumpFilejava.io.IOException - if the dump file contents could not be accessedprotected abstract boolean fetchIsDone()
public static java.lang.String getDumpFilePostfix(DumpContentType dumpContentType)
dumpContentType - the type of dumpjava.lang.IllegalArgumentException - if the given dump file type is not knownpublic static java.lang.String getDumpFileWebDirectory(DumpContentType dumpContentType, java.lang.String projectName)
dumpContentType - the type of dumpjava.lang.IllegalArgumentException - if the given dump file type is not knownpublic static org.wikidata.wdtk.util.CompressionType getDumpFileCompressionType(java.lang.String fileName)
fileName - the name of the filejava.lang.IllegalArgumentException - if the given dump file type is not knownpublic static java.lang.String getDumpFileDirectoryName(DumpContentType dumpContentType, java.lang.String dateStamp)
dumpContentType - the type of the dumpdateStamp - the date of the dump in format YYYYMMDDpublic static java.lang.String getDateStampFromDumpFileDirectoryName(DumpContentType dumpContentType, java.lang.String directoryName)
getDumpFileDirectoryName(DumpContentType, String).
It is not checked that the given directory name has the right format; if
it has not, the result will not be a date stamp but some other string.dumpContentType - directoryName - public static java.lang.String getDumpFileName(DumpContentType dumpContentType, java.lang.String projectName, java.lang.String dateStamp)
dumpContentType - the type of the dumpprojectName - the project name, e.g. "wikidatawiki"dateStamp - the date of the dump in format YYYYMMDDpublic static boolean isRevisionDumpFile(DumpContentType dumpContentType)
dumpContentType - the type of dumpjava.lang.IllegalArgumentException - if the given dump file type is not knownCopyright © 2014–2017 Wikidata Toolkit Developers. Generated from source code published under the Apache License 2.0. For more information, see the Wikidata Toolkit homepage