PenProfile 2.x

com.livescribe.afp
Class Document

java.lang.Object
  extended by com.livescribe.afp.Document

public abstract class Document
extends Object

This class encapsulates a paper product and associated metadata. The metadata includes such things as the number of pages, the number of copies, a GUID, and document title.


Constructor Summary
Document()
           
 
Method Summary
abstract  String getGUID()
          Gets the unique identifier of this document.
abstract  int getNumberOfCopies()
          Gets the number of copies of this document.
abstract  int getNumberOfPages()
          Gets the number of pages contained in this document.
abstract  InputStream getResource(String path)
          Retrieves the contents of a file from the document as an input stream.
abstract  String getTitle()
          Gets the title of this document.
abstract  boolean isInUse()
          Indicates if the document is in use.
abstract  Enumeration listUserdataFiles()
          Lists all the files, including those in subdirectories, contained within the document.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Document

public Document()
Method Detail

getNumberOfPages

public abstract int getNumberOfPages()
Gets the number of pages contained in this document.

Returns:
integer representing the number of pages in this document.

getNumberOfCopies

public abstract int getNumberOfCopies()
Gets the number of copies of this document.

Returns:
integer representing the number of copies of the document.

getGUID

public abstract String getGUID()
Gets the unique identifier of this document. This returns a string.

Returns:
the unique GUID of this document.

getTitle

public abstract String getTitle()
Gets the title of this document. If no title is set, then this returns an empty string.

Returns:
the document title or an empty string.

isInUse

public abstract boolean isInUse()
Indicates if the document is in use. A document is in use if at least one of the following is true:

Returns:
true if the document is in use and false otherwise.

getResource

public abstract InputStream getResource(String path)
                                 throws IOException
Retrieves the contents of a file from the document as an input stream.

Parameters:
path - the file path
Returns:
an input stream connected to the file contents, or null if the file is not found.
Throws:
IOException - if there was an I/O error.
See Also:
#listUserdataFiles()}

listUserdataFiles

public abstract Enumeration listUserdataFiles()
Lists all the files, including those in subdirectories, contained within the document.

Returns:
Enumeration of file paths (String)

PenProfile 2.x

Copyright © 2010 Livescribe Inc. All Rights Reserved.
Confidential and subject to NDA.