|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.itextpdf.tool.xml.net.FileRetrieveImpl
public class FileRetrieveImpl
| Constructor Summary | |
|---|---|
FileRetrieveImpl()
|
|
FileRetrieveImpl(File rootdir)
Constructs a new FileRetrieveImpl with the given root url's and directories |
|
FileRetrieveImpl(String... strings)
Constructs a new FileRetrieveImpl with the given root url's and directories |
|
| Method Summary | |
|---|---|
void |
addRootDir(File dir)
Add a root directory. |
void |
addURL(String url)
Add a root URL. |
void |
processFromHref(String href,
ReadingProcessor processor)
ProcessFromHref first tries to create an URL from the given href,
if that throws a MalformedURLException, it will prepend the given
root URLs to href until a valid URL is found.If by then there is no valid url found, this method will see if the given href is a valid file
and can read it.If it's not a valid file or a file that can't be read, the given root directories will be set as root path with the given href as
file path until a valid file has been found. |
void |
processFromStream(InputStream in,
ReadingProcessor processor)
Process content from a given stream. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public FileRetrieveImpl()
public FileRetrieveImpl(String... strings)
strings - an array of strings, if the String starts with http or
https it's taken as URL otherwise we check if it's a directory
with
File f = new File(str); f.isDirectory()
public FileRetrieveImpl(File rootdir)
strings - an array of strings, if the String starts with http or
https it's taken as URL otherwise we check if it's a directory
with
File f = new File(str); f.isDirectory()
| Method Detail |
|---|
public void processFromHref(String href,
ReadingProcessor processor)
throws IOException
URL from the given href,
if that throws a MalformedURLException, it will prepend the given
root URLs to href until a valid URL is found.href is a valid file
and can read it.href as
file path until a valid file has been found.
processFromHref in interface FileRetrievehref - the URL to processprocessor - the ReadingProcessor
IOException - if something went wrong.
public void processFromStream(InputStream in,
ReadingProcessor processor)
throws IOException
FileRetrieve
processFromStream in interface FileRetrievein - the stream to processprocessor - the ReadingProcessor
IOException - if something went wrong.public void addRootDir(File dir)
dir - the root directorypublic void addURL(String url)
url - the URL
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||