Class FileCrawler
- java.lang.Object
-
- gov.nasa.pds.tools.validate.crawler.Crawler
-
- gov.nasa.pds.tools.validate.crawler.FileCrawler
-
public class FileCrawler extends Crawler
Class that crawls a given file url.- Author:
- mcayanan
-
-
Field Summary
-
Fields inherited from class gov.nasa.pds.tools.validate.crawler.Crawler
directoryFilter, fileFilter, ignoreList
-
-
Constructor Summary
Constructors Constructor Description FileCrawler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<Target>
crawl(URL fileUrl, boolean getDirectories, org.apache.commons.io.filefilter.IOFileFilter fileFilter)
Crawl a given directory url.List<Target>
crawl(URL fileUrl, String[] extensions, boolean getDirectories, String nameToken)
Crawl a given directory url.List<Target>
crawl(URL fileUrl, String[] extensions, boolean getDirectories, String nameToken, boolean ignoreCaseFlag)
Crawl a given directory url.-
Methods inherited from class gov.nasa.pds.tools.validate.crawler.Crawler
addAllIgnoreItems, crawl, crawl, crawl, setFileFilter, setFileFilter
-
-
-
-
Method Detail
-
crawl
public List<Target> crawl(URL fileUrl, boolean getDirectories, org.apache.commons.io.filefilter.IOFileFilter fileFilter) throws IOException
Crawl a given directory url.- Specified by:
crawl
in classCrawler
- Parameters:
fileUrl
- File url.- Returns:
- A list of files and sub-directories (if found and if getSubDirectories flag is 'true').
- Throws:
IOException
-
crawl
public List<Target> crawl(URL fileUrl, String[] extensions, boolean getDirectories, String nameToken, boolean ignoreCaseFlag) throws IOException
Crawl a given directory url.- Parameters:
fileUrl
- File url.extensions
- The file matching file a list of file extensions.getDirectories
- Flag if True will crawl next sub directory.nameToken
- The substring will be searched for in the file names. Note that the search will be done in all lower cased if ignoreCaseFlag is true.ignoreCaseFlag
- Flag to ignore case when comparing the file name found with the nameToken.- Returns:
- A list of files and sub-directories (if found and if getSubDirectories flag is 'true').
- Throws:
IOException
-
crawl
public List<Target> crawl(URL fileUrl, String[] extensions, boolean getDirectories, String nameToken) throws IOException
Crawl a given directory url.- Overrides:
crawl
in classCrawler
- Parameters:
fileUrl
- File url.extensions
- The file matching file a list of file extensions.getDirectories
- Flag if True will crawl next sub directory.nameToken
- The substring will be searched for in the file names. Note that the search will be done in all lower cased.- Returns:
- A list of files and sub-directories (if found and if getSubDirectories flag is 'true').
- Throws:
IOException
-
-