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
- Author:
- Rainer Prosi, Heidelberger Druckmaschinen
walker that extracts all URLs and dumps them to a directory
URLS are modified to reflect the new location
dir
protected final File dir
baseURL
protected final String baseURL
protocols
protected Set<UrlUtil.URLProtocol> protocols
currentURL
protected final String currentURL
saved
protected Set<String> saved
URLExtractor
public URLExtractor(File dumpDir,
String currentURL,
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
addProtocol
public void addProtocol(UrlUtil.URLProtocol protocol)
- add a protocol to the list of protocols that are supported
- Parameters:
protocol - the protocol to add
getFactory
protected BaseWalkerFactory getFactory()
- Overrides:
getFactory in class BaseElementWalker
- Returns:
- the factory for this worker
convert
public KElement convert(KElement e)
- Description copied from interface:
IElementConverter
- generic converter that converts an element
- Specified by:
convert in interface IElementConverter
- Parameters:
e - the element to convert
- Returns:
- the converted element
- See Also:
IElementConverter.convert(org.cip4.jdflib.core.KElement)
toString
public String toString()
- Overrides:
toString in class ElementWalker
- See Also:
ElementWalker.toString()
Copyright © 2013. All Rights Reserved.