Package jcifs
Interface CIFSContext
-
- All Known Implementing Classes:
AbstractCIFSContext
,BaseContext
,CIFSContextCredentialWrapper
,CIFSContextWrapper
,SingletonContext
public interface CIFSContext
Encapsulation of client context A context holds the client configuration, shared services as well as the active credentials. Usually you will want to create one context per client configuration and then multiple sub-contexts using different credentials (if necessary).withDefaultCredentials()
,withAnonymousCredentials()
,withCredentials(Credentials)
allow to create such sub-contexts. Implementors of this interface should extendBaseContext
orCIFSContextWrapper
to get forward compatibility.- Author:
- mbechler
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
close()
SmbResource
get(String url)
Get a resourceBufferCache
getBufferCache()
Configuration
getConfig()
Credentials
getCredentials()
DfsResolver
getDfs()
NameServiceClient
getNameServiceClient()
SmbPipeResource
getPipe(String url, int pipeType)
Get a pipe resourceSidResolver
getSIDResolver()
SmbTransportPool
getTransportPool()
URLStreamHandler
getUrlHandler()
boolean
hasDefaultCredentials()
boolean
renewCredentials(String locationHint, Throwable error)
CIFSContext
withAnonymousCredentials()
CIFSContext
withCredentials(Credentials creds)
CIFSContext
withDefaultCredentials()
CIFSContext
withGuestCrendentials()
-
-
-
Method Detail
-
get
SmbResource get(String url) throws CIFSException
Get a resource- Parameters:
url
-- Returns:
- the SMB resource at the specified location
- Throws:
CIFSException
-
getPipe
SmbPipeResource getPipe(String url, int pipeType) throws CIFSException
Get a pipe resource- Parameters:
url
-pipeType
- the type of the pipe- Returns:
- the SMB pipe resource at the specified location
- Throws:
CIFSException
-
close
boolean close() throws CIFSException
- Returns:
- whether any connection was still in use
- Throws:
CIFSException
-
getConfig
Configuration getConfig()
- Returns:
- the active configuration
-
getNameServiceClient
NameServiceClient getNameServiceClient()
- Returns:
- the name server client
-
getBufferCache
BufferCache getBufferCache()
- Returns:
- the buffer cache
-
getTransportPool
SmbTransportPool getTransportPool()
- Returns:
- the transport pool
-
getDfs
DfsResolver getDfs()
- Returns:
- the DFS instance for this context
-
getSIDResolver
SidResolver getSIDResolver()
- Returns:
- the SID resolver for this context
-
getCredentials
Credentials getCredentials()
- Returns:
- the used credentials
-
getUrlHandler
URLStreamHandler getUrlHandler()
- Returns:
- an URL handler using this context
-
hasDefaultCredentials
boolean hasDefaultCredentials()
- Returns:
- whether default credentials are available
-
withDefaultCredentials
CIFSContext withDefaultCredentials()
- Returns:
- a child context using the configured default credentials
-
withAnonymousCredentials
CIFSContext withAnonymousCredentials()
- Returns:
- a child context using anonymous credentials
-
withGuestCrendentials
CIFSContext withGuestCrendentials()
- Returns:
- a child context using guest credentials
-
withCredentials
CIFSContext withCredentials(Credentials creds)
- Parameters:
creds
-- Returns:
- a child context using using the given credentials
-
-