Class URLExtractor

All Implemented Interfaces:
IElementConverter

public class URLExtractor extends BaseElementWalker implements IElementConverter
  • Field Details

    • dir

      protected final File dir
    • baseURL

      protected final String baseURL
    • protocols

      protected Set<UrlUtil.URLProtocol> protocols
    • currentURL

      protected final String currentURL
    • saved

      protected final Map<String,String> saved
    • deleteFile

      protected boolean deleteFile
  • Constructor Details

    • 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 Details

    • 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 Set<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: IElementConverter
      generic converter that converts an element
      Specified by:
      convert in interface IElementConverter
      Parameters:
      root - the element to convert
      Returns:
      the converted element
      See Also:
    • toString

      public String toString()
      Overrides:
      toString in class ElementWalker
      See Also: