public class ExampleHelpers extends Object
OFFLINE_MODE
or not.Modifier and Type | Class and Description |
---|---|
static class |
ExampleHelpers.DumpProcessingMode
Enum to say which dumps should be downloaded and processed.
|
Modifier and Type | Field and Description |
---|---|
static ExampleHelpers.DumpProcessingMode |
DUMP_FILE_MODE
Defines which dumps will be downloaded and processed in all examples.
|
static String |
EXAMPLE_OUTPUT_DIRECTORY
The directory where to place files created by the example applications.
|
static boolean |
OFFLINE_MODE
If set to true, all example programs will run in offline mode.
|
static int |
TIMEOUT_SEC
Timeout to abort processing after a short while or 0 to disable timeout.
|
Constructor and Description |
---|
ExampleHelpers() |
Modifier and Type | Method and Description |
---|---|
static void |
configureLogging()
Defines how messages should be logged.
|
static String |
getLastDumpFileName()
Returns the name of the dump file that was last processed.
|
static FileOutputStream |
openExampleFileOuputStream(String filename)
Opens a new FileOutputStream for a file of the given name in the example
output directory (
EXAMPLE_OUTPUT_DIRECTORY ). |
static void |
processEntitiesFromWikidataDump(EntityDocumentProcessor entityDocumentProcessor)
Processes all entities in a Wikidata dump using the given entity
processor.
|
public static final boolean OFFLINE_MODE
public static final ExampleHelpers.DumpProcessingMode DUMP_FILE_MODE
public static final String EXAMPLE_OUTPUT_DIRECTORY
public static final int TIMEOUT_SEC
public static void configureLogging()
public static void processEntitiesFromWikidataDump(EntityDocumentProcessor entityDocumentProcessor)
entityDocumentProcessor
- the object to use for processing entities in this dumppublic static FileOutputStream openExampleFileOuputStream(String filename) throws IOException
EXAMPLE_OUTPUT_DIRECTORY
). Any
file of this name that exists already will be replaced. The caller is
responsible for eventually closing the stream.filename
- the name of the file to write toIOException
- if the file or example output directory could not be createdpublic static String getLastDumpFileName()
Copyright © 2014–2024 Wikidata Toolkit Developers. Generated from source code published under the Apache License 2.0. For more information, see the Wikidata Toolkit homepage