org.sejda.model.input
Class PdfURLSource

java.lang.Object
  extended by org.sejda.model.input.AbstractPdfSource<URL>
      extended by org.sejda.model.input.PdfURLSource
All Implemented Interfaces:
PdfSource<URL>

public final class PdfURLSource
extends AbstractPdfSource<URL>

AbstractPdfSource from a URL

Author:
Andrea Vacondio

Method Summary
 URL getSource()
           
static PdfURLSource newInstanceNoPassword(URL url, String name)
          Creates a new instance of the pdf source where a password is NOT required to open the source.
static PdfURLSource newInstanceWithPassword(URL url, String name, String password)
          Creates a new instance of the pdf source where a password is required to open the source.
<T> T
open(PdfSourceOpener<T> opener)
          Dispatch method to open the source.
 String toString()
           
 
Methods inherited from class org.sejda.model.input.AbstractPdfSource
getName, getPassword, getPasswordBytes
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

getSource

public URL getSource()
Returns:
the source

open

public <T> T open(PdfSourceOpener<T> opener)
       throws TaskIOException
Description copied from interface: PdfSource
Dispatch method to open the source.

Type Parameters:
T - generic type as result of the open action.
Returns:
result of the open action as a type defined by the dispatcher.
Throws:
TaskIOException - in case of error opening the source.

toString

public String toString()
Overrides:
toString in class AbstractPdfSource<URL>

newInstanceNoPassword

public static PdfURLSource newInstanceNoPassword(URL url,
                                                 String name)
Creates a new instance of the pdf source where a password is NOT required to open the source.

Parameters:
url - input URL to a pdf document
name -
Returns:
a newly created instance

newInstanceWithPassword

public static PdfURLSource newInstanceWithPassword(URL url,
                                                   String name,
                                                   String password)
Creates a new instance of the pdf source where a password is required to open the source.

Parameters:
url - input URL to a pdf document
name -
password -
Returns:
a newly created instance
Throws:
IllegalArgumentException - if the input stream or the input name are blank.


Copyright © 2013 sejda. All Rights Reserved.