org.cip4.jdflib.elementwalker
Class URLExtractor

java.lang.Object
  extended by org.cip4.jdflib.elementwalker.ElementWalker
      extended by org.cip4.jdflib.elementwalker.BaseElementWalker
          extended by 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

Nested Class Summary
 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
 
Field Summary
protected  String baseURL
           
protected  String currentURL
           
protected  File dir
           
protected  Set<UrlUtil.URLProtocol> protocols
           
protected  Set<String> saved
           
 
Fields inherited from class org.cip4.jdflib.elementwalker.BaseElementWalker
log
 
Fields inherited from class org.cip4.jdflib.elementwalker.ElementWalker
theFactory
 
Constructor Summary
URLExtractor(File dumpDir, String currentURL, String baseURL)
           
 
Method Summary
 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
protected  BaseWalkerFactory getFactory()
           
 String toString()
           
 
Methods inherited from class org.cip4.jdflib.elementwalker.BaseElementWalker
constructWalkers
 
Methods inherited from class org.cip4.jdflib.elementwalker.ElementWalker
walkTree, walkTreeKidsFirst
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

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
Constructor Detail

URLExtractor

public URLExtractor(File dumpDir,
                    String currentURL,
                    String baseURL)
Parameters:
dumpDir - the local directory where any files are dumped
currentURL - 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

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.