Class LocalFetcher
java.lang.Object
com.norconex.crawler.core.fetch.AbstractFetcher<LocalFetcherConfig>
com.norconex.crawler.fs.fetch.impl.AbstractNioFetcher<LocalFetcherConfig>
com.norconex.crawler.fs.fetch.impl.local.LocalFetcher
- All Implemented Interfaces:
Configurable<LocalFetcherConfig>,EventListener<Event>,Fetcher,EventListener,Consumer<Event>
Fetcher for a local file system, backed by the JDK's default
FileSystemProvider. Mounted file systems and
mapped drives not requiring special configuration to access can also be
considered "local". Paths starting with any of the following will be
recognized as local file system:
file:///some/directoryfile:///C:/some/directory/some/directoryC:\some\directoryC:/some/directory
Access Control List (ACL)
This fetcher will try to extract access control information for each file
of a local file system. If you have no need for them, you can disable
acquiring them with LocalFetcherConfig.setAclDisabled(boolean).
Archive files as file systems
Archive files (zip, tar, jar, etc.) are no longer handled by this fetcher.
Use ArchiveFetcher
instead, which supports both local and remote archives and provides
credential configuration for inner remote file systems.
-
Field Summary
Fields inherited from interface com.norconex.commons.lang.config.Configurable
PROPERTY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanacceptRequest(@NonNull FetchRequest fetchRequest) Optional method for subclasses to override when in need for additional acceptance logic beyond reference filters (which this abstract class provides).protected booleanbooleanprotected voidfetchMetadata(Doc doc, @NonNull Path path, @NonNull BasicFileAttributes attrs) inthashCode()protected PathresolvePath(String reference) Resolves a crawler reference (as found onDoc.getReference()) into a NIO.2Path.toString()Methods inherited from class com.norconex.crawler.fs.fetch.impl.AbstractNioFetcher
fetch, fetchChildPaths, fetchContent, fetcherShutdown, fetchFileObject, getOrOpenFileSystemMethods inherited from class com.norconex.crawler.core.fetch.AbstractFetcher
accept, accept, fetcherStartup
-
Constructor Details
-
LocalFetcher
public LocalFetcher()
-
-
Method Details
-
acceptRequest
Description copied from class:AbstractFetcherOptional method for subclasses to override when in need for additional acceptance logic beyond reference filters (which this abstract class provides). This method is only invoked if there are no reference filters configured on this class, or all of them accepts the request document. Default implementation does nothing (always returntrue).- Overrides:
acceptRequestin classAbstractFetcher<LocalFetcherConfig>- Parameters:
fetchRequest- the fetch request to evaluate (nevernull)- Returns:
trueif accepted
-
resolvePath
Description copied from class:AbstractNioFetcherResolves a crawler reference (as found onDoc.getReference()) into a NIO.2Path.- Specified by:
resolvePathin classAbstractNioFetcher<LocalFetcherConfig>- Parameters:
reference- the reference to resolve- Returns:
- the resolved path
-
fetchMetadata
protected void fetchMetadata(Doc doc, @NonNull @NonNull Path path, @NonNull @NonNull BasicFileAttributes attrs) throws IOException - Overrides:
fetchMetadatain classAbstractNioFetcher<LocalFetcherConfig>- Throws:
IOException
-
toString
- Overrides:
toStringin classAbstractNioFetcher<LocalFetcherConfig>
-
equals
- Overrides:
equalsin classAbstractNioFetcher<LocalFetcherConfig>
-
canEqual
- Overrides:
canEqualin classAbstractNioFetcher<LocalFetcherConfig>
-
hashCode
public int hashCode()- Overrides:
hashCodein classAbstractNioFetcher<LocalFetcherConfig>
-
getConfiguration
-