java.lang.Object
org.codelibs.jcifs.smb1.Dfs
Implements DFS (Distributed File System) referral caching and resolution.
This class manages DFS referral cache and provides DFS path resolution functionality.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected org.codelibs.jcifs.smb1.Dfs.CacheEntryCache of trusted domains for DFS resolutionprotected static org.codelibs.jcifs.smb1.Dfs.CacheEntrySentinel cache entry indicating a negative cache resultprotected org.codelibs.jcifs.smb1.Dfs.CacheEntryCache of DFS referrals -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetDc(String domain, NtlmPasswordAuthentication auth) Gets a domain controller transport for the specified domaingetReferral(SmbTransport trans, String domain, String root, String path, NtlmPasswordAuthentication auth) Gets a DFS referral for the specified pathGets the map of trusted domains for DFS resolutionbooleanisTrustedDomain(String domain, NtlmPasswordAuthentication auth) Checks if a domain is trusted for DFS operationsresolve(String domain, String root, String path, NtlmPasswordAuthentication auth) Resolves a DFS path to obtain referral information
-
Field Details
-
FALSE_ENTRY
protected static org.codelibs.jcifs.smb1.Dfs.CacheEntry FALSE_ENTRYSentinel cache entry indicating a negative cache result -
_domains
protected org.codelibs.jcifs.smb1.Dfs.CacheEntry _domainsCache of trusted domains for DFS resolution -
referrals
protected org.codelibs.jcifs.smb1.Dfs.CacheEntry referralsCache of DFS referrals
-
-
Constructor Details
-
Dfs
public Dfs()Default constructor for Dfs. Initializes the DFS referral system.
-
-
Method Details
-
getTrustedDomains
Gets the map of trusted domains for DFS resolution- Parameters:
auth- the authentication credentials- Returns:
- a map of trusted domain names to domain controllers
- Throws:
SmbAuthException- if authentication fails
-
isTrustedDomain
public boolean isTrustedDomain(String domain, NtlmPasswordAuthentication auth) throws SmbAuthException Checks if a domain is trusted for DFS operations- Parameters:
domain- the domain name to checkauth- the authentication credentials- Returns:
- true if the domain is trusted, false otherwise
- Throws:
SmbAuthException- if authentication fails
-
getDc
Gets a domain controller transport for the specified domain- Parameters:
domain- the domain nameauth- the authentication credentials- Returns:
- an SMB transport to the domain controller
- Throws:
SmbAuthException- if authentication fails
-
getReferral
public DfsReferral getReferral(SmbTransport trans, String domain, String root, String path, NtlmPasswordAuthentication auth) throws SmbAuthException Gets a DFS referral for the specified path- Parameters:
trans- the SMB transport to usedomain- the domain nameroot- the DFS rootpath- the path to resolveauth- the authentication credentials- Returns:
- a DFS referral or null if not found
- Throws:
SmbAuthException- if authentication fails
-
resolve
public DfsReferral resolve(String domain, String root, String path, NtlmPasswordAuthentication auth) throws SmbAuthException Resolves a DFS path to obtain referral information- Parameters:
domain- the domain nameroot- the DFS rootpath- the path to resolveauth- the authentication credentials- Returns:
- a DFS referral for the resolved path
- Throws:
SmbAuthException- if authentication fails
-