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 java.lang.String |
baseURL |
protected java.lang.String |
currentURL |
protected boolean |
deleteFile |
protected java.io.File |
dir |
protected java.util.Set<UrlUtil.URLProtocol> |
protocols |
protected java.util.Set<java.lang.String> |
saved |
log, theFactory| Constructor and Description |
|---|
URLExtractor(java.io.File dumpDir,
java.lang.String currentURL,
java.lang.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
|
java.util.Set<java.lang.String> |
getSaved()
Getter for list of saved files
|
boolean |
isDeleteFile() |
void |
setDeleteFile(boolean deleteFile) |
void |
setWantLog(boolean bWant) |
java.lang.String |
toString() |
getFactorywalkTree, walkTreeKidsFirstprotected final java.io.File dir
protected final java.lang.String baseURL
protected java.util.Set<UrlUtil.URLProtocol> protocols
protected final java.lang.String currentURL
protected final java.util.Set<java.lang.String> saved
protected boolean deleteFile
public URLExtractor(java.io.File dumpDir,
java.lang.String currentURL,
java.lang.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 java.util.Set<java.lang.String> getSaved()
public 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)
IElementConverterconvert in interface IElementConvertere - the element to convertIElementConverter.convert(org.cip4.jdflib.core.KElement)public java.lang.String toString()
toString in class ElementWalkerElementWalker.toString()