MwDumpFilepublic class MwLocalDumpFile extends java.lang.Object implements MwDumpFile
MwDumpFile.DateComparator| Constructor | Description |
|---|---|
MwLocalDumpFile(java.lang.String filepath) |
Constructor.
|
MwLocalDumpFile(java.lang.String filePath,
DumpContentType dumpContentType,
java.lang.String dateStamp,
java.lang.String projectName) |
Constructor.
|
| Modifier and Type | Method | Description |
|---|---|---|
java.lang.String |
getDateStamp() |
Returns the date stamp for this dump.
|
DumpContentType |
getDumpContentType() |
Returns information about the content of the dump.
|
java.io.BufferedReader |
getDumpFileReader() |
Returns a buffered reader that provides access to the (uncompressed) text
content of the dump file.
|
java.io.InputStream |
getDumpFileStream() |
Returns an input stream that provides access to the (uncompressed) text
content of the dump file.
|
java.nio.file.Path |
getPath() |
Returns the absolute path to this dump file.
|
java.lang.String |
getProjectName() |
Returns the project name for this dump.
|
boolean |
isAvailable() |
Checks if the dump is actually available.
|
void |
prepareDumpFile() |
Prepares the dump file for access via
MwDumpFile.getDumpFileStream() or
MwDumpFile.getDumpFileReader(). |
java.lang.String |
toString() |
public MwLocalDumpFile(java.lang.String filepath)
filepath - Path to the dump file in the file systempublic MwLocalDumpFile(java.lang.String filePath,
DumpContentType dumpContentType,
java.lang.String dateStamp,
java.lang.String projectName)
filePath - Path to the dump file in the file systemdumpContentType - DumpContentType of the dump file, or null if not known to
guess it from file name; this information is essential to
invoke the correct processing code to read the dump filedateStamp - dump date in format YYYYMMDD, or null if not known to guess it
from file name; this is mainly used for logs and messagesprojectName - project name string, or null to use a default string; this is
mainly used for logs and messagespublic java.nio.file.Path getPath()
public 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 getProjectName()
MwDumpFilegetProjectName in interface MwDumpFilepublic java.lang.String getDateStamp()
MwDumpFilegetDateStamp in interface MwDumpFilepublic DumpContentType getDumpContentType()
MwDumpFilegetDumpContentType in interface MwDumpFilepublic java.io.InputStream getDumpFileStream()
throws java.io.IOException
MwDumpFileIt is important to close the stream after use.
getDumpFileStream in interface MwDumpFilejava.io.IOException - if the dump file contents could not be accessedpublic 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 accessedpublic void prepareDumpFile()
MwDumpFileMwDumpFile.getDumpFileStream() or
MwDumpFile.getDumpFileReader(). In particular, this will download any
remote files.prepareDumpFile in interface MwDumpFilepublic java.lang.String toString()
toString in class java.lang.ObjectCopyright © 2014–2017 Wikidata Toolkit Developers. Generated from source code published under the Apache License 2.0. For more information, see the Wikidata Toolkit homepage