java.lang.Object
java.lang.Thread
org.codelibs.jcifs.smb.context.AbstractCIFSContext
org.codelibs.jcifs.smb.context.BaseContext
org.codelibs.jcifs.smb.context.SingletonContext
- All Implemented Interfaces:
Runnable,CIFSContext
Global singleton context
- 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 -
Method Summary
Modifier and TypeMethodDescriptionstatic final SingletonContextGet singleton context The singleton context will use system properties for configuration as well as values specified in a file specified through thisorg.codelibs.jcifs.smb.propertiessystem property.static final voidinit(Properties props) Initialize singleton context using custom properties This method can only be called once.static voidThis static method registers the SMB URL protocol handler which is required to use SMB URLs with thejava.net.URLclass.Methods inherited from class org.codelibs.jcifs.smb.context.BaseContext
close, get, getBufferCache, getConfig, getDefaultCredentials, getDfs, getNameServiceClient, getPipe, getSIDResolver, getTransportPool, getUrlHandlerMethods inherited from class org.codelibs.jcifs.smb.context.AbstractCIFSContext
getCredentials, hasDefaultCredentials, renewCredentials, run, withAnonymousCredentials, withCredentials, withDefaultCredentials, withGuestCredentialsMethods 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
close, get, getBufferCache, getConfig, getCredentials, getDfs, getNameServiceClient, getPipe, getSIDResolver, getTransportPool, getUrlHandler, hasDefaultCredentials, renewCredentials, withAnonymousCredentials, withCredentials, withDefaultCredentials, withGuestCredentials
-
Method Details
-
init
Initialize singleton context using custom properties This method can only be called once.- Parameters:
props- the properties to use for initialization- Throws:
CIFSException- if the singleton context is already initialized or there is an error during initialization
-
getInstance
Get singleton context The singleton context will use system properties for configuration as well as values specified in a file specified through thisorg.codelibs.jcifs.smb.propertiessystem property.- Returns:
- a global context, initialized on first call
-
registerSmbURLHandler
public static void registerSmbURLHandler()This static method registers the SMB URL protocol handler which is required to use SMB URLs with thejava.net.URLclass. If this method is not called before attempting to create an SMB URL with the URL class the following exception will occur:Exception MalformedURLException: unknown protocol: smb at java.net.URL.<init>(URL.java:480) at java.net.URL.<init>(URL.java:376) at java.net.URL.<init>(URL.java:330) at org.codelibs.jcifs.smb.impl.SmbFile.<init>(SmbFile.java:355) ...
-