com.norconex.committer.impl
Class FileSystemCommitter

java.lang.Object
  extended by com.norconex.committer.impl.FileSystemCommitter
All Implemented Interfaces:
ICommitter, IXMLConfigurable, Serializable

public class FileSystemCommitter
extends Object
implements ICommitter, IXMLConfigurable

Commits a copy of files on the filesystem. Mostly useful for troubleshooting.

XML configuration usage:

  <committer class="com.norconex.committer.FileSystemCommitter">
      <directory>(path where to save files)</directory>
  </committer>
 

Author:
Pascal Essiembre
See Also:
Serialized Form

Field Summary
static String DEFAULT_DIRECTORY
           
 
Fields inherited from interface com.norconex.committer.ICommitter
DEFAULT_DOCUMENT_REFERENCE
 
Constructor Summary
FileSystemCommitter()
           
 
Method Summary
 void commit()
          Commits queued documents.
 boolean equals(Object obj)
           
 File getAddDir()
           
 String getDirectory()
           
 File getRemoveDir()
           
 int hashCode()
           
 void loadFromXML(Reader in)
           
 void queueAdd(String reference, File document, Properties metadata)
          Queues a new or modified document.
 void queueRemove(String reference, File document, Properties metadata)
          Queues a document for removal.
 void saveToXML(Writer out)
           
 void setDirectory(String directory)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

DEFAULT_DIRECTORY

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

FileSystemCommitter

public FileSystemCommitter()
Method Detail

getDirectory

public String getDirectory()

setDirectory

public void setDirectory(String directory)

queueAdd

public void queueAdd(String reference,
                     File document,
                     Properties metadata)
Description copied from interface: ICommitter
Queues a new or modified document. These queued documents should be sent to their target destination when commit is called.

Specified by:
queueAdd in interface ICommitter
Parameters:
reference - document reference (e.g. URL)
document - text document
metadata - document metadata

queueRemove

public void queueRemove(String reference,
                        File document,
                        Properties metadata)
Description copied from interface: ICommitter
Queues a document for removal. These queued documents should be sent to their target destination for deletion when commit is called.

Specified by:
queueRemove in interface ICommitter
Parameters:
reference - document reference (e.g. URL)
document - text document
metadata - document metadata

commit

public void commit()
Description copied from interface: ICommitter
Commits queued documents. Effectively apply the additions and removals.

Specified by:
commit in interface ICommitter

getAddDir

public File getAddDir()

getRemoveDir

public File getRemoveDir()

loadFromXML

public void loadFromXML(Reader in)
Specified by:
loadFromXML in interface IXMLConfigurable

saveToXML

public void saveToXML(Writer out)
               throws IOException
Specified by:
saveToXML in interface IXMLConfigurable
Throws:
IOException

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

toString

public String toString()
Overrides:
toString in class Object


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