Class SmbFetcher
java.lang.Object
com.norconex.crawler.core.fetch.AbstractFetcher<SmbFetcherConfig>
com.norconex.crawler.fs.fetch.impl.AbstractNioFetcher<SmbFetcherConfig>
com.norconex.crawler.fs.fetch.impl.smb.SmbFetcher
- All Implemented Interfaces:
Configurable<SmbFetcherConfig>,EventListener<Event>,Fetcher,EventListener,Consumer<Event>
CIFS fetcher (Samba, Windows share) (smb://), backed by a
custom, read-only NIO.2 FileSystemProvider
(SmbFileSystemProvider) built directly on jcifs-ng's classic
SmbFile API.
Access Control List (ACL)
When asked to (see SmbFetcherConfig.setAcl(AclFetchMode)), this
fetcher writes who may read each file in the standard
crawler.acl field: the share's permissions
(AclFetchMode.EXTENDED only) and the file's, each a level a person
must pass. An entry allowing or denying the read-data right is an allow
or a deny. Principals are SIDs, with their account names when the server
resolves them. On a Linux server shared through Samba (see
SmbFetcherConfig.setLinuxServer(boolean)), a path level
says who may go through the folders above the file.
-
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 voidfetcherShutdown(CrawlerSession crawler) Invoked once per fetcher when the crawler ends.protected voidfetcherStartup(CrawlerSession crawler) Invoked once per fetcher instance, when the crawler starts.protected 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, fetchFileObject, fetchFolderMetadata, getOrOpenFileSystemMethods inherited from class com.norconex.crawler.core.fetch.AbstractFetcher
accept, accept
-
Constructor Details
-
SmbFetcher
public SmbFetcher()
-
-
Method Details
-
fetcherStartup
Description copied from class:AbstractFetcherInvoked once per fetcher instance, when the crawler starts. Default implementation does nothing.- Overrides:
fetcherStartupin classAbstractFetcher<SmbFetcherConfig>- Parameters:
crawler- crawler
-
fetcherShutdown
Description copied from class:AbstractFetcherInvoked once per fetcher when the crawler ends. Default implementation does nothing.- Overrides:
fetcherShutdownin classAbstractNioFetcher<SmbFetcherConfig>- Parameters:
crawler- crawler
-
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<SmbFetcherConfig>- 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<SmbFetcherConfig>- Parameters:
reference- the reference to resolve- Returns:
- the resolved path
- Throws:
IOException- if the reference cannot be resolved
-
fetchMetadata
protected void fetchMetadata(Doc doc, @NonNull @NonNull Path path, @NonNull @NonNull BasicFileAttributes attrs) throws IOException - Overrides:
fetchMetadatain classAbstractNioFetcher<SmbFetcherConfig>- Throws:
IOException
-
toString
- Overrides:
toStringin classAbstractNioFetcher<SmbFetcherConfig>
-
equals
- Overrides:
equalsin classAbstractNioFetcher<SmbFetcherConfig>
-
canEqual
- Overrides:
canEqualin classAbstractNioFetcher<SmbFetcherConfig>
-
hashCode
public int hashCode()- Overrides:
hashCodein classAbstractNioFetcher<SmbFetcherConfig>
-
getConfiguration
-