java.lang.Object
java.lang.Thread
org.codelibs.jcifs.smb.context.AbstractCIFSContext
- All Implemented Interfaces:
Runnable,CIFSContext
- Direct Known Subclasses:
BaseContext
Abstract base implementation of CIFSContext providing common functionality.
This class serves as a foundation for concrete CIFS context implementations.
- Author:
- mbechler
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler -
Field Summary
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor that registers a shutdown hook for cleanup -
Method Summary
Modifier and TypeMethodDescriptionbooleanclose()Close all connections and release resources associated with this contextGet the credentials associated with this contextprotected abstract CredentialsGets the default credentials for this context.booleanCheck if default credentials are configuredbooleanrenewCredentials(String locationHint, Throwable error) Attempt to renew credentials after authentication failurevoidrun()Create a child context with anonymous credentialswithCredentials(Credentials creds) Create a child context with specified credentialsCreate a child context with default credentialsCreate a child context with guest credentialsMethods inherited from class java.lang.Thread
activeCount, checkAccess, clone, countStackFrames, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, suspend, toString, yieldMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.codelibs.jcifs.smb.CIFSContext
get, getBufferCache, getConfig, getDfs, getNameServiceClient, getPipe, getSIDResolver, getTransportPool, getUrlHandler
-
Constructor Details
-
AbstractCIFSContext
public AbstractCIFSContext()Default constructor that registers a shutdown hook for cleanup
-
-
Method Details
-
withCredentials
Description copied from interface:CIFSContextCreate a child context with specified credentials- Specified by:
withCredentialsin interfaceCIFSContext- Parameters:
creds- the credentials to use- Returns:
- a wrapped context with the given credentials
-
withAnonymousCredentials
Create a child context with anonymous credentials- Specified by:
withAnonymousCredentialsin interfaceCIFSContext- Returns:
- a child context using anonymous credentials
- See Also:
-
withDefaultCredentials
Create a child context with default credentials- Specified by:
withDefaultCredentialsin interfaceCIFSContext- Returns:
- a child context using the configured default credentials
- See Also:
-
withGuestCredentials
Create a child context with guest credentials- Specified by:
withGuestCredentialsin interfaceCIFSContext- Returns:
- a child context using guest credentials
- See Also:
-
getCredentials
Get the credentials associated with this context- Specified by:
getCredentialsin interfaceCIFSContext- Returns:
- the used credentials
- See Also:
-
hasDefaultCredentials
public boolean hasDefaultCredentials()Check if default credentials are configured- Specified by:
hasDefaultCredentialsin interfaceCIFSContext- Returns:
- whether default credentials are available
- See Also:
-
getDefaultCredentials
Gets the default credentials for this context.- Returns:
- the default credentials for this context
-
renewCredentials
Attempt to renew credentials after authentication failure- Specified by:
renewCredentialsin interfaceCIFSContext- Parameters:
locationHint- URL or location hint for credential renewalerror- the error that triggered renewal- Returns:
- whether new credentials are obtained
- See Also:
-
close
Close all connections and release resources associated with this context- Specified by:
closein interfaceCIFSContext- Returns:
- whether any connection was still in use
- Throws:
CIFSException- if an error occurs during cleanup- See Also:
-
run
public void run()
-