Package org.cip4.jdflib.elementwalker
Class URLExtractor
- java.lang.Object
-
- org.cip4.jdflib.elementwalker.ElementWalker
-
- org.cip4.jdflib.elementwalker.BaseElementWalker
-
- org.cip4.jdflib.elementwalker.URLExtractor
-
- All Implemented Interfaces:
IElementConverter
public class URLExtractor extends BaseElementWalker implements IElementConverter
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classURLExtractor.WalkElementthe URL walkerclassURLExtractor.WalkURLthe resource walker note the naming convention Walkxxx so that it is automagically instantiated by the super classes
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.StringbaseURLprotected java.lang.StringcurrentURLprotected booleandeleteFileprotected java.io.Filedirprotected java.util.Set<UrlUtil.URLProtocol>protocolsprotected java.util.Map<java.lang.String,java.lang.String>saved-
Fields inherited from class org.cip4.jdflib.elementwalker.ElementWalker
theFactory
-
-
Constructor Summary
Constructors Constructor Description URLExtractor(java.io.File dumpDir, java.lang.String currentURL, java.lang.String baseURL)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddProtocol(UrlUtil.URLProtocol protocol)add a protocol to the list of protocols that are supportedKElementconvert(KElement root)generic converter that converts an elementjava.util.Set<java.lang.String>getSaved()Getter for list of saved filesbooleanisDeleteFile()voidsetDeleteFile(boolean deleteFile)voidsetWantLog(boolean bWant)java.lang.StringtoString()-
Methods inherited from class org.cip4.jdflib.elementwalker.BaseElementWalker
getFactory
-
Methods inherited from class org.cip4.jdflib.elementwalker.ElementWalker
walkTree, walkTreeKidsFirst
-
-
-
-
Field Detail
-
dir
protected final java.io.File dir
-
baseURL
protected final java.lang.String baseURL
-
protocols
protected java.util.Set<UrlUtil.URLProtocol> protocols
-
currentURL
protected final java.lang.String currentURL
-
saved
protected final java.util.Map<java.lang.String,java.lang.String> saved
-
deleteFile
protected boolean deleteFile
-
-
Constructor Detail
-
URLExtractor
public URLExtractor(java.io.File dumpDir, java.lang.String currentURL, java.lang.String baseURL)- Parameters:
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 environment
-
-
Method Detail
-
isDeleteFile
public boolean isDeleteFile()
- Returns:
- the deleteFile
-
setDeleteFile
public void setDeleteFile(boolean deleteFile)
- Parameters:
deleteFile- the deleteFile to set; if true files are move rather than copied note that files are NOT removed from zip or mime packages
-
getSaved
public java.util.Set<java.lang.String> getSaved()
Getter for list of saved files- Returns:
- the saved
-
setWantLog
public void setWantLog(boolean bWant)
- Parameters:
bWant- if true, we will log each move
-
addProtocol
public void addProtocol(UrlUtil.URLProtocol protocol)
add a protocol to the list of protocols that are supported- Parameters:
protocol- the protocol to add
-
convert
public KElement convert(KElement root)
Description copied from interface:IElementConvertergeneric converter that converts an element- Specified by:
convertin interfaceIElementConverter- Parameters:
root- the element to convert- Returns:
- the converted element
- See Also:
IElementConverter.convert(org.cip4.jdflib.core.KElement)
-
toString
public java.lang.String toString()
- Overrides:
toStringin classElementWalker- See Also:
ElementWalker.toString()
-
-