org.apache.manifoldcf.agents.interfaces
Class RepositoryDocument

java.lang.Object
  extended by org.apache.manifoldcf.agents.interfaces.RepositoryDocument

public class RepositoryDocument
extends java.lang.Object

This class contains the complete information for a document, as read from a repository. The generator of this document is one of the repository connectors; the user of the class is the incremental ingester. Data contained within is described in part by a binary stream (which is expected to be processed), and partly by already-extracted textual data. These streams MUST BE CLOSED BY THE CALLER when the repository document instance has been ingested. The streams also WILL NOT ever be reset; they are read to the end once only.


Nested Class Summary
protected static class RepositoryDocument.Security
          This class describes allow and deny tokens for a specific security class.
 
Field Summary
static java.lang.String _rcsid
           
protected  java.io.InputStream binaryFieldData
           
protected  long binaryLength
           
protected  java.util.ArrayList directorySecurity
           
protected  java.util.HashMap fields
           
protected  RepositoryDocument.Security fileSecurity
           
protected  RepositoryDocument.Security shareSecurity
           
 
Constructor Summary
RepositoryDocument()
          Constructor.
 
Method Summary
 void addDirectoryACLs(java.lang.String[] allowACL, java.lang.String[] denyACL)
          Add directory security entry
 void addField(java.lang.String fieldName, java.io.Reader fieldData)
          Add a character field.
 void addField(java.lang.String fieldName, java.io.Reader[] fieldData)
          Add a multivalue character field.
 void addField(java.lang.String fieldName, java.lang.String fieldData)
          Add a character field.
 void addField(java.lang.String fieldName, java.lang.String[] fieldData)
          Remove a multivalue character field.
 void clearDirectoryACLs()
          Clear all directory acls.
 int countDirectoryACLs()
          Get a count of directory security entries.
 int fieldCount()
          Get the number of fields.
 java.lang.String[] getACL()
          Get the document's "file" allow acl, if any.
 long getBinaryLength()
          Get the binary length.
 java.io.InputStream getBinaryStream()
          Get the binary fields (if any).
 java.lang.String[] getDenyACL()
          Get the document's deny acl, if any.
 java.lang.String[] getDirectoryACL(int index)
          Get directory security access acl
 java.lang.String[] getDirectoryDenyACL(int index)
          Get directory security deny acl
 java.lang.Object[] getField(java.lang.String fieldName)
          Get a field.
 java.util.Iterator getFields()
          Iterate through the field name Strings.
 java.lang.String[] getShareACL()
          Get document's "share" acl.
 java.lang.String[] getShareDenyACL()
          Get document's "share" deny acl.
 void setACL(java.lang.String[] acl)
          Set the document's "file" allow acls.
 void setBinary(java.io.InputStream binaryFieldData, long binaryLength)
          Set the binary field.
 void setDenyACL(java.lang.String[] acl)
          Set the document's "file" deny acl.
 void setShareACL(java.lang.String[] acl)
          Set document's "share" acl.
 void setShareDenyACL(java.lang.String[] acl)
          Set document's "share" deny acl.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_rcsid

public static final java.lang.String _rcsid
See Also:
Constant Field Values

binaryFieldData

protected java.io.InputStream binaryFieldData

binaryLength

protected long binaryLength

fields

protected java.util.HashMap fields

fileSecurity

protected RepositoryDocument.Security fileSecurity

shareSecurity

protected RepositoryDocument.Security shareSecurity

directorySecurity

protected java.util.ArrayList directorySecurity
Constructor Detail

RepositoryDocument

public RepositoryDocument()
Constructor.

Method Detail

setACL

public void setACL(java.lang.String[] acl)
Set the document's "file" allow acls.

Parameters:
acl - is the allowed "file" access control token list for the document.

getACL

public java.lang.String[] getACL()
Get the document's "file" allow acl, if any.

Returns:
the allow access control token list for the document.

setDenyACL

public void setDenyACL(java.lang.String[] acl)
Set the document's "file" deny acl.

Parameters:
acl - is the "file" denied access control token list for the document.

getDenyACL

public java.lang.String[] getDenyACL()
Get the document's deny acl, if any.

Returns:
the deny access control token list for the document.

setShareACL

public void setShareACL(java.lang.String[] acl)
Set document's "share" acl.


getShareACL

public java.lang.String[] getShareACL()
Get document's "share" acl.


setShareDenyACL

public void setShareDenyACL(java.lang.String[] acl)
Set document's "share" deny acl.


getShareDenyACL

public java.lang.String[] getShareDenyACL()
Get document's "share" deny acl.


clearDirectoryACLs

public void clearDirectoryACLs()
Clear all directory acls.


countDirectoryACLs

public int countDirectoryACLs()
Get a count of directory security entries.


addDirectoryACLs

public void addDirectoryACLs(java.lang.String[] allowACL,
                             java.lang.String[] denyACL)
Add directory security entry


getDirectoryACL

public java.lang.String[] getDirectoryACL(int index)
Get directory security access acl


getDirectoryDenyACL

public java.lang.String[] getDirectoryDenyACL(int index)
Get directory security deny acl


setBinary

public void setBinary(java.io.InputStream binaryFieldData,
                      long binaryLength)
Set the binary field.

Parameters:
binaryFieldData - is the input stream containing binary data.

getBinaryStream

public java.io.InputStream getBinaryStream()
Get the binary fields (if any).

Returns:
the binary stream.

getBinaryLength

public long getBinaryLength()
Get the binary length.

Returns:
the length in bytes.

addField

public void addField(java.lang.String fieldName,
                     java.io.Reader[] fieldData)
              throws ManifoldCFException
Add a multivalue character field.

Parameters:
fieldName - is the field name.
fieldData - is the multi-valued data (as an array of Readers). Null means to remove the entry from the document.
Throws:
ManifoldCFException

addField

public void addField(java.lang.String fieldName,
                     java.io.Reader fieldData)
              throws ManifoldCFException
Add a character field.

Parameters:
fieldName - is the field name.
fieldData - is the single-valued data (as a Reader). Null means "no value".
Throws:
ManifoldCFException

addField

public void addField(java.lang.String fieldName,
                     java.lang.String[] fieldData)
              throws ManifoldCFException
Remove a multivalue character field.

Parameters:
fieldName - is the field name.
fieldData - is the multi-valued data (as a an array of Strings). Null means to remove the entry from the document.
Throws:
ManifoldCFException

addField

public void addField(java.lang.String fieldName,
                     java.lang.String fieldData)
              throws ManifoldCFException
Add a character field.

Parameters:
fieldName - is the field name.
fieldData - is the single-valued data (as a String). Null means "no value".
Throws:
ManifoldCFException

getField

public java.lang.Object[] getField(java.lang.String fieldName)
Get a field.

Parameters:
fieldName - is the field name.
Returns:
the field data (either a Reader array or a String array).

fieldCount

public int fieldCount()
Get the number of fields.


getFields

public java.util.Iterator getFields()
Iterate through the field name Strings.