com.norconex.importer
Class Importer

java.lang.Object
  extended by com.norconex.importer.Importer

public class Importer
extends Object

Principal class responsible for importing documents.

Author:
Pascal Essiembre

Field Summary
static String DOC_CONTENT_TYPE
           
static String DOC_REFERENCE
           
static String IMPORTER_PREFIX
           
 
Constructor Summary
Importer()
          Creates a new importer with default configuration.
Importer(ImporterConfig importerConfig)
          Creates a new importer with the given configuration.
 
Method Summary
 boolean importDocument(File input, ContentType contentType, File output, Properties metadata, String docReference)
          Imports a document according to the importer configuration.
 boolean importDocument(File input, File output, Properties metadata)
          Imports a document according to the importer configuration.
 boolean importDocument(InputStream input, ContentType contentType, Writer output, Properties metadata, String docReference)
          Imports a document according to the importer configuration.
 boolean importDocument(InputStream input, Writer output, Properties metadata)
          Imports a document according to the importer configuration.
static void main(String[] args)
          Invokes the importer from the command line.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

IMPORTER_PREFIX

public static final String IMPORTER_PREFIX
See Also:
Constant Field Values

DOC_REFERENCE

public static final String DOC_REFERENCE
See Also:
Constant Field Values

DOC_CONTENT_TYPE

public static final String DOC_CONTENT_TYPE
See Also:
Constant Field Values
Constructor Detail

Importer

public Importer()
Creates a new importer with default configuration.


Importer

public Importer(ImporterConfig importerConfig)
Creates a new importer with the given configuration.

Parameters:
importerConfig -
Method Detail

main

public static void main(String[] args)
Invokes the importer from the command line.

Parameters:
args - Invoke it once without any arguments to get a list of command-line options.

importDocument

public boolean importDocument(InputStream input,
                              Writer output,
                              Properties metadata)
                       throws IOException
Imports a document according to the importer configuration.

Parameters:
input - document input
output - document output
metadata - the document starting metadata
Returns:
true if the document has successfully been imported, false if the document was rejected (i.e. filtered)
Throws:
IOException - problem importing document

importDocument

public boolean importDocument(InputStream input,
                              ContentType contentType,
                              Writer output,
                              Properties metadata,
                              String docReference)
                       throws IOException
Imports a document according to the importer configuration.

Parameters:
input - document input
contentType - document content-type
output - document output
metadata - the document starting metadata
docReference - document reference (e.g. URL, file path, etc)
Returns:
true if the document has successfully been imported, false if the document was rejected (i.e. filtered)
Throws:
IOException - problem importing document

importDocument

public boolean importDocument(File input,
                              File output,
                              Properties metadata)
                       throws IOException
Imports a document according to the importer configuration.

Parameters:
input - document input
output - document output
metadata - the document starting metadata
Returns:
true if the document has successfully been imported, false if the document was rejected (i.e. filtered)
Throws:
IOException - problem importing document

importDocument

public boolean importDocument(File input,
                              ContentType contentType,
                              File output,
                              Properties metadata,
                              String docReference)
                       throws IOException
Imports a document according to the importer configuration.

Parameters:
input - document input
contentType - document content-type
output - document output
metadata - the document starting metadata
docReference - document reference (e.g. URL, file path, etc)
Returns:
true if the document has successfully been imported, false if the document was rejected (i.e. filtered)
Throws:
IOException - problem importing document


Copyright © 2009-2013 Norconex Inc.. All Rights Reserved.