public class URLExtractor extends BaseElementWalker implements IElementConverter
Modifier and Type | Class and Description |
---|---|
class |
URLExtractor.WalkElement
the URL walker
|
class |
URLExtractor.WalkURL
the resource walker note the naming convention Walkxxx so that it is automagically instantiated by the super classes
|
Modifier and Type | Field and Description |
---|---|
protected String |
baseURL |
protected String |
currentURL |
protected boolean |
deleteFile |
protected File |
dir |
protected Set<UrlUtil.URLProtocol> |
protocols |
protected Set<String> |
saved |
log
theFactory
Constructor and Description |
---|
URLExtractor(File dumpDir,
String currentURL,
String baseURL) |
Modifier and Type | Method and Description |
---|---|
void |
addProtocol(UrlUtil.URLProtocol protocol)
add a protocol to the list of protocols that are supported
|
KElement |
convert(KElement e)
generic converter that converts an element
|
Set<String> |
getSaved()
Getter for list of saved files
|
boolean |
isDeleteFile() |
void |
setDeleteFile(boolean deleteFile) |
void |
setWantLog(boolean bWant) |
String |
toString() |
getFactory
walkTree, walkTreeKidsFirst
protected final File dir
protected final String baseURL
protected Set<UrlUtil.URLProtocol> protocols
protected final String currentURL
protected boolean deleteFile
public URLExtractor(File dumpDir, String currentURL, String baseURL)
dumpDir
- the local directory where any files are dumpedcurrentURL
- the current local input url for relative urls - in general this will be a file url (cwd)baseURL
- the base output url of the extracted data, for instance in an http server environmentpublic boolean isDeleteFile()
public void setDeleteFile(boolean deleteFile)
deleteFile
- the deleteFile to set; if true files are move rather than copied note that files are NOT removed from zip or mime packagespublic void setWantLog(boolean bWant)
bWant
- if true, we will log each movepublic void addProtocol(UrlUtil.URLProtocol protocol)
protocol
- the protocol to addpublic KElement convert(KElement e)
IElementConverter
convert
in interface IElementConverter
e
- the element to convertIElementConverter.convert(org.cip4.jdflib.core.KElement)
public String toString()
toString
in class ElementWalker
ElementWalker.toString()
Copyright © 2018. All rights reserved.