org.sejda.model.input
Class AbstractPdfSource<T>

java.lang.Object
  extended by org.sejda.model.input.AbstractPdfSource<T>
Type Parameters:
T - the generic type of the source
All Implemented Interfaces:
PdfSource<T>
Direct Known Subclasses:
PdfFileSource, PdfStreamSource, PdfURLSource

public abstract class AbstractPdfSource<T>
extends Object
implements PdfSource<T>

Skeletal implementation for a pdf input source.

Author:
Andrea Vacondio

Constructor Summary
AbstractPdfSource(String name)
          Creates a source with the given name.
AbstractPdfSource(String name, String password)
          Creates a source with the given name and password.
 
Method Summary
 String getName()
           
 String getPassword()
           
 byte[] getPasswordBytes()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.sejda.model.input.PdfSource
getSource, open
 

Constructor Detail

AbstractPdfSource

public AbstractPdfSource(String name)
Creates a source with the given name.

Parameters:
name -
Throws:
IllegalArgumentException - if the name is blank

AbstractPdfSource

public AbstractPdfSource(String name,
                         String password)
Creates a source with the given name and password.

Parameters:
name -
password -
Throws:
IllegalArgumentException - if the name is blank
Method Detail

getPassword

public String getPassword()
Specified by:
getPassword in interface PdfSource<T>
Returns:
password needed to open the source. Cna be null.

getPasswordBytes

public byte[] getPasswordBytes()
Returns:
the password in bytes or null if no password has been set

getName

public String getName()
Specified by:
getName in interface PdfSource<T>
Returns:
the name of this source

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2013 sejda. All Rights Reserved.