Module jcifs

Class BaseConfiguration

java.lang.Object
org.codelibs.jcifs.smb.config.BaseConfiguration
All Implemented Interfaces:
Configuration
Direct Known Subclasses:
PropertyConfiguration

public class BaseConfiguration extends Object implements Configuration
Base implementation of CIFS configuration providing default settings and behavior. Serves as the foundation for configuration implementations in the jCIFS library.
Author:
mbechler
  • Field Details

    • localPid

      protected int localPid
      Local process ID for SMB messages
    • localTimeZone

      protected TimeZone localTimeZone
      Local timezone for time calculations
    • random

      protected SecureRandom random
      Secure random generator for cryptographic operations
    • useBatching

      protected boolean useBatching
      Whether to use command batching for improved performance
    • useUnicode

      protected boolean useUnicode
      Whether to use Unicode encoding for strings
    • forceUnicode

      protected boolean forceUnicode
      Force use of Unicode encoding regardless of negotiation
    • signingPreferred

      protected boolean signingPreferred
      Whether SMB signing is preferred but not required
    • signingEnforced

      protected boolean signingEnforced
      Whether SMB signing is enforced (required)
    • ipcSigningEnforced

      protected boolean ipcSigningEnforced
      Whether to enforce signing for IPC connections
    • encryptionEnabled

      protected boolean encryptionEnabled
      Whether SMB3 encryption is enabled
    • useNtStatus

      protected boolean useNtStatus
      Whether to use NT status codes instead of DOS error codes
    • useExtendedSecurity

      protected boolean useExtendedSecurity
      Whether to use extended security negotiation
    • forceExtendedSecurity

      protected boolean forceExtendedSecurity
      Force use of extended security negotiation
    • smb2OnlyNegotiation

      protected boolean smb2OnlyNegotiation
      Whether to negotiate only SMB2 or higher protocols
    • port139FailoverEnabled

      protected boolean port139FailoverEnabled
      Whether to failover to port 139 if port 445 fails
    • useNTSmbs

      protected boolean useNTSmbs
      Whether to use NT SMB operations
    • useLargeReadWrite

      protected boolean useLargeReadWrite
      Whether to use large read/write operations for better performance
    • lanmanCompatibility

      protected int lanmanCompatibility
      LAN Manager compatibility level for authentication
    • allowNTLMFallback

      protected boolean allowNTLMFallback
      Whether to allow fallback to NTLM authentication
    • useRawNTLM

      protected boolean useRawNTLM
      Whether to use raw NTLM authentication without SPNEGO
    • disableSpnegoIntegrity

      protected boolean disableSpnegoIntegrity
      Whether to disable SPNEGO integrity checking
    • enforceSpnegoIntegrity

      protected boolean enforceSpnegoIntegrity
      Whether to enforce SPNEGO integrity checking
    • disablePlainTextPasswords

      protected boolean disablePlainTextPasswords
      Whether plain text passwords are disabled
    • oemEncoding

      protected String oemEncoding
      OEM encoding for non-Unicode operations
    • flags2

      protected int flags2
      SMB flags2 field value
    • capabilities

      protected int capabilities
      SMB client capabilities
    • sessionLimit

      protected int sessionLimit
      Maximum number of concurrent SMB sessions
    • smbTcpNoDelay

      protected boolean smbTcpNoDelay
      Whether to disable Nagle's algorithm for TCP connections
    • smbResponseTimeout

      protected int smbResponseTimeout
      Response timeout in milliseconds for SMB operations
    • smbSocketTimeout

      protected int smbSocketTimeout
      Socket timeout in milliseconds for SMB connections
    • smbConnectionTimeout

      protected int smbConnectionTimeout
      Connection timeout in milliseconds for establishing SMB connections
    • smbSessionTimeout

      protected int smbSessionTimeout
      Session timeout in milliseconds for SMB sessions
    • idleTimeoutDisabled

      protected boolean idleTimeoutDisabled
      Whether idle timeout is disabled for connections
    • smbLocalAddress

      protected InetAddress smbLocalAddress
      Local address to bind for SMB connections
    • smbLocalPort

      protected int smbLocalPort
      Local port to bind for SMB connections
    • maxMpxCount

      protected int maxMpxCount
      Maximum multiplex count for concurrent requests
    • smbSendBufferSize

      protected int smbSendBufferSize
      Send buffer size for SMB socket operations
    • smbRecvBufferSize

      protected int smbRecvBufferSize
      Receive buffer size for SMB socket operations
    • smbNotifyBufferSize

      protected int smbNotifyBufferSize
      Buffer size for SMB notification operations
    • nativeOs

      protected String nativeOs
      Native operating system name to report
    • nativeLanMan

      protected String nativeLanMan
      Native LAN Manager string to report
    • vcNumber

      protected int vcNumber
      Virtual circuit number for SMB sessions
    • dfsDisabled

      protected boolean dfsDisabled
      Whether DFS support is disabled
    • dfsTTL

      protected long dfsTTL
      DFS cache time-to-live in seconds
    • dfsStrictView

      protected boolean dfsStrictView
      Whether to use strict DFS path resolution
    • dfsConvertToFqdn

      protected boolean dfsConvertToFqdn
      Whether to convert DFS paths to FQDN
    • preserveShareCase

      protected boolean preserveShareCase
      Whether to preserve share name case instead of converting to uppercase
    • logonShare

      protected String logonShare
      Default logon share
    • defaultDomain

      protected String defaultDomain
      Default domain for authentication
    • defaultUserName

      protected String defaultUserName
      Default username for authentication
    • defaultPassword

      protected String defaultPassword
      Default password for authentication
    • netbiosHostname

      protected String netbiosHostname
      NetBIOS hostname
    • netbiosCachePolicy

      protected int netbiosCachePolicy
      NetBIOS name cache policy in seconds
    • netbiosSocketTimeout

      protected int netbiosSocketTimeout
      NetBIOS socket timeout in milliseconds
    • netbiosSendBufferSize

      protected int netbiosSendBufferSize
      NetBIOS send buffer size
    • netbiosRevcBufferSize

      protected int netbiosRevcBufferSize
      NetBIOS receive buffer size
    • netbiosRetryCount

      protected int netbiosRetryCount
      NetBIOS retry count
    • netbiosRetryTimeout

      protected int netbiosRetryTimeout
      NetBIOS retry timeout in milliseconds
    • netbiosScope

      protected String netbiosScope
      NetBIOS scope identifier
    • netbiosLocalPort

      protected int netbiosLocalPort
      Local port for NetBIOS communications
    • netbiosLocalAddress

      protected InetAddress netbiosLocalAddress
      Local address for NetBIOS communications
    • lmhostsFilename

      protected String lmhostsFilename
      Path to lmhosts file for NetBIOS name resolution
    • winsServer

      protected InetAddress[] winsServer
      Array of WINS server addresses for NetBIOS name resolution
    • broadcastAddress

      protected InetAddress broadcastAddress
      Broadcast address for NetBIOS name resolution
    • resolverOrder

      protected List<ResolverType> resolverOrder
      Order of name resolution methods to use
    • maximumBufferSize

      protected int maximumBufferSize
      Maximum buffer size for IO operations
    • transactionBufferSize

      protected int transactionBufferSize
      Maximum buffer size for SMB transaction operations
    • bufferCacheSize

      protected int bufferCacheSize
      Number of buffers to keep in cache
    • smbListSize

      protected int smbListSize
      Maximum size for list operations
    • smbListCount

      protected int smbListCount
      Maximum number of entries to return in list operations
    • smbAttributeExpiration

      protected long smbAttributeExpiration
      Time in milliseconds before cached file attributes expire
    • ignoreCopyToException

      protected boolean ignoreCopyToException
      Whether to ignore exceptions during file copy operations
    • maxRequestRetries

      protected int maxRequestRetries
      Maximum number of request retries on failure
    • traceResourceUsage

      protected boolean traceResourceUsage
      Whether to trace resource usage for debugging
    • strictResourceLifecycle

      protected boolean strictResourceLifecycle
      Whether to enforce strict resource lifecycle management
    • disallowCompound

      protected Set<String> disallowCompound
      Set of commands that should not be used in compound requests
    • minVersion

      protected DialectVersion minVersion
      Minimum SMB dialect version to negotiate
    • maxVersion

      protected DialectVersion maxVersion
      Maximum SMB dialect version to negotiate
    • requireSecureNegotiate

      protected boolean requireSecureNegotiate
      Whether to require secure negotiate validation
    • sendNTLMTargetName

      protected boolean sendNTLMTargetName
      Whether to send NTLM target name during authentication
    • guestUsername

      protected String guestUsername
      Username for guest authentication
    • guestPassword

      protected String guestPassword
      Password for guest authentication
    • allowGuestFallback

      protected boolean allowGuestFallback
      Whether to allow fallback to guest authentication
  • Constructor Details

    • BaseConfiguration

      protected BaseConfiguration() throws CIFSException
      Constructs a BaseConfiguration with default settings
      Throws:
      CIFSException - if configuration initialization fails
    • BaseConfiguration

      public BaseConfiguration(boolean initDefaults) throws CIFSException
      Constructs a BaseConfiguration with optional default initialization
      Parameters:
      initDefaults - whether to initialize defaults based on other settings
      Throws:
      CIFSException - if configuration initialization fails
  • Method Details

    • getRandom

      public SecureRandom getRandom()
      Description copied from interface: Configuration
      Gets the secure random number generator for cryptographic operations
      Specified by:
      getRandom in interface Configuration
      Returns:
      random source to use
    • getNetbiosHostname

      public String getNetbiosHostname()
      Description copied from interface: Configuration
      Property org.codelibs.jcifs.smb.netbios.hostname (string)
      Specified by:
      getNetbiosHostname in interface Configuration
      Returns:
      local NETBIOS/short name to announce
    • getLocalAddr

      public InetAddress getLocalAddr()
      Description copied from interface: Configuration
      Property org.codelibs.jcifs.smb.impl.client.laddr (string)
      Specified by:
      getLocalAddr in interface Configuration
      Returns:
      local address to use for outgoing connections
    • getLocalPort

      public int getLocalPort()
      Description copied from interface: Configuration
      Property org.codelibs.jcifs.smb.impl.client.lport (int)
      Specified by:
      getLocalPort in interface Configuration
      Returns:
      local port to use for outgoing connections
    • getConnTimeout

      public int getConnTimeout()
      Description copied from interface: Configuration
      Property org.codelibs.jcifs.smb.impl.client.connTimeout (int, default 35000)
      Specified by:
      getConnTimeout in interface Configuration
      Returns:
      timeout for establishing a socket connection, in milliseconds
    • getResponseTimeout

      public int getResponseTimeout()
      Description copied from interface: Configuration
      Property org.codelibs.jcifs.smb.impl.client.responseTimeout (int, default 30000)
      Specified by:
      getResponseTimeout in interface Configuration
      Returns:
      timeout for SMB responses, in milliseconds
    • getSoTimeout

      public int getSoTimeout()
      Description copied from interface: Configuration
      Property org.codelibs.jcifs.smb.impl.client.soTimeout (int, default 35000)
      Specified by:
      getSoTimeout in interface Configuration
      Returns:
      socket timeout, in milliseconds
    • getSessionTimeout

      public int getSessionTimeout()
      Description copied from interface: Configuration
      Property org.codelibs.jcifs.smb.impl.client.sessionTimeout (int, default 35000)
      Specified by:
      getSessionTimeout in interface Configuration
      Returns:
      timeout for SMB sessions, in milliseconds
    • getSendBufferSize

      public int getSendBufferSize()
      Description copied from interface: Configuration
      Property org.codelibs.jcifs.smb.impl.client.snd_buf_size (int, default 65535)
      Specified by:
      getSendBufferSize in interface Configuration
      Returns:
      send buffer size, in bytes
    • getRecieveBufferSize

      @Deprecated public int getRecieveBufferSize()
      Deprecated.
      Description copied from interface: Configuration
      Property org.codelibs.jcifs.smb.impl.client.rcv_buf_size (int, default 65535)
      Specified by:
      getRecieveBufferSize in interface Configuration
      Returns:
      receive buffer size, in bytes
    • getReceiveBufferSize

      public int getReceiveBufferSize()
      Description copied from interface: Configuration
      Property org.codelibs.jcifs.smb.impl.client.rcv_buf_size (int, default 65535)
      Specified by:
      getReceiveBufferSize in interface Configuration
      Returns:
      receive buffer size, in bytes
    • getNotifyBufferSize

      public int getNotifyBufferSize()
      Description copied from interface: Configuration
      Property org.codelibs.jcifs.smb.impl.client.notify_buf_size (int, default 1024)
      Specified by:
      getNotifyBufferSize in interface Configuration
      Returns:
      the size of the requested server notify buffer
    • getMaxMpxCount

      public int getMaxMpxCount()
      Description copied from interface: Configuration
      Property org.codelibs.jcifs.smb.impl.client.maxMpxCount (int, default 10)
      Specified by:
      getMaxMpxCount in interface Configuration
      Returns:
      maximum count of concurrent commands to announce
    • getNativeLanman

      public String getNativeLanman()
      Description copied from interface: Configuration
      Property org.codelibs.jcifs.smb.impl.client.nativeLanMan (string, default jCIFS)
      Specified by:
      getNativeLanman in interface Configuration
      Returns:
      Lanman string to report
    • getNativeOs

      public String getNativeOs()
      Description copied from interface: Configuration
      Property org.codelibs.jcifs.smb.impl.client.nativeOs (string, default os.name)
      Specified by:
      getNativeOs in interface Configuration
      Returns:
      OS string to report
    • getVcNumber

      public int getVcNumber()
      Description copied from interface: Configuration
      Gets the virtual circuit number for SMB connections
      Specified by:
      getVcNumber in interface Configuration
      Returns:
      virtual circuit number to use
    • getCapabilities

      public int getCapabilities()
      Description copied from interface: Configuration
      Property org.codelibs.jcifs.smb.impl.client.capabilities (int)
      Specified by:
      getCapabilities in interface Configuration
      Returns:
      custom capabilities
    • getMinimumVersion

      public DialectVersion getMinimumVersion()
      Description copied from interface: Configuration
      Minimum protocol version Property org.codelibs.jcifs.smb.impl.client.minVersion (string, default SMB1)
      Specified by:
      getMinimumVersion in interface Configuration
      Returns:
      minimum protocol version to use/allow
      See Also:
    • getMaximumVersion

      public DialectVersion getMaximumVersion()
      Description copied from interface: Configuration
      Maximum protocol version Property org.codelibs.jcifs.smb.impl.client.maxVersion (string, default SMB210)
      Specified by:
      getMaximumVersion in interface Configuration
      Returns:
      maximum protocol version to use/allow
      See Also:
    • isUseSMB2OnlyNegotiation

      public boolean isUseSMB2OnlyNegotiation()
      Description copied from interface: Configuration
      Use SMB2 non-backward compatible negotiation style Property org.codelibs.jcifs.smb.impl.client.useSMB2Negotiation (boolean, default false)
      Specified by:
      isUseSMB2OnlyNegotiation in interface Configuration
      Returns:
      whether to use non-backward compatible protocol negotiation
    • isRequireSecureNegotiate

      public boolean isRequireSecureNegotiate()
      Description copied from interface: Configuration
      Enforce secure negotiation Property org.codelibs.jcifs.smb.impl.client.requireSecureNegotiate (boolean, default true) This does not provide any actual downgrade protection if SMB1 is allowed. It will also break connections with SMB2 servers that do not properly sign error responses.
      Specified by:
      isRequireSecureNegotiate in interface Configuration
      Returns:
      whether to enforce the use of secure negotiation.
    • isPort139FailoverEnabled

      public boolean isPort139FailoverEnabled()
      Description copied from interface: Configuration
      Enable port 139 failover Property org.codelibs.jcifs.smb.impl.client.port139.enabled (boolean, default false)
      Specified by:
      isPort139FailoverEnabled in interface Configuration
      Returns:
      whether to failover to legacy transport on port 139
    • isUseBatching

      public boolean isUseBatching()
      Description copied from interface: Configuration
      Property org.codelibs.jcifs.smb.impl.client.useBatching (boolean, default false)
      Specified by:
      isUseBatching in interface Configuration
      Returns:
      whether to enable support for SMB1 AndX command batching
    • isUseUnicode

      public boolean isUseUnicode()
      Description copied from interface: Configuration
      Property org.codelibs.jcifs.smb.impl.client.useUnicode (boolean, default true)
      Specified by:
      isUseUnicode in interface Configuration
      Returns:
      whether to announce support for unicode
    • isForceUnicode

      public boolean isForceUnicode()
      Description copied from interface: Configuration
      Property org.codelibs.jcifs.smb.impl.client.forceUnicode (boolean, default false)
      Specified by:
      isForceUnicode in interface Configuration
      Returns:
      whether to use unicode, even if the server does not announce it
    • isDfsDisabled

      public boolean isDfsDisabled()
      Description copied from interface: Configuration
      Property org.codelibs.jcifs.smb.impl.client.dfs.disabled (boolean, default false)
      Specified by:
      isDfsDisabled in interface Configuration
      Returns:
      whether DFS lookup is disabled
    • isDfsStrictView

      public boolean isDfsStrictView()
      Description copied from interface: Configuration
      Property org.codelibs.jcifs.smb.impl.client.dfs.strictView (boolean, default false)
      Specified by:
      isDfsStrictView in interface Configuration
      Returns:
      whether a authentication failure during DFS resolving will throw an exception
    • getDfsTtl

      public long getDfsTtl()
      Description copied from interface: Configuration
      Property org.codelibs.jcifs.smb.impl.client.dfs.ttl (int, default 300)
      Specified by:
      getDfsTtl in interface Configuration
      Returns:
      title to live, in seconds, for DFS cache entries
    • isDfsConvertToFQDN

      public boolean isDfsConvertToFQDN()
      Description copied from interface: Configuration
      Enable hack to make kerberos auth work with DFS sending short names This works by appending the domain name to the netbios short name and will fail horribly if this mapping is not correct for your domain. Property org.codelibs.jcifs.smb.impl.client.dfs.convertToFQDN (boolean, default false)
      Specified by:
      isDfsConvertToFQDN in interface Configuration
      Returns:
      whether to convert NetBIOS names returned by DFS to FQDNs
    • isPreserveShareCase

      public boolean isPreserveShareCase()
      Description copied from interface: Configuration
      Whether to preserve share name case When true, preserve the original case of share names instead of converting to uppercase. This is required for DFS namespaces with case-sensitive link names. Property jcifs.smb.client.preserveShareCase (boolean, default false)
      Specified by:
      isPreserveShareCase in interface Configuration
      Returns:
      whether to preserve share name case
    • getLogonShare

      public String getLogonShare()
      Description copied from interface: Configuration
      Property org.codelibs.jcifs.smb.impl.client.logonShare
      Specified by:
      getLogonShare in interface Configuration
      Returns:
      share to connect to during authentication, if unset connect to IPC$
    • getDefaultDomain

      public String getDefaultDomain()
      Description copied from interface: Configuration
      Property org.codelibs.jcifs.smb.impl.client.domain
      Specified by:
      getDefaultDomain in interface Configuration
      Returns:
      default credentials, domain name
    • getDefaultUsername

      public String getDefaultUsername()
      Description copied from interface: Configuration
      Property org.codelibs.jcifs.smb.impl.client.username
      Specified by:
      getDefaultUsername in interface Configuration
      Returns:
      default credentials, user name
    • getDefaultPassword

      public String getDefaultPassword()
      Description copied from interface: Configuration
      Property org.codelibs.jcifs.smb.impl.client.password
      Specified by:
      getDefaultPassword in interface Configuration
      Returns:
      default credentials, password
    • isDisablePlainTextPasswords

      public boolean isDisablePlainTextPasswords()
      Description copied from interface: Configuration
      Property org.codelibs.jcifs.smb.impl.client.disablePlainTextPasswords (boolean, default true)
      Specified by:
      isDisablePlainTextPasswords in interface Configuration
      Returns:
      whether the usage of plaintext passwords is prohibited, defaults to false
    • getLanManCompatibility

      public int getLanManCompatibility()
      Description copied from interface: Configuration
      Lanman compatibility level Microsoft TechNet Documentation
      LM Compatibility Levels
      0 or 1 LM and NTLM
      2 NTLM only
      3-5 NTLMv2 only
      Property org.codelibs.jcifs.smb.impl.lmCompatibility (int, default 3)
      Specified by:
      getLanManCompatibility in interface Configuration
      Returns:
      lanman compatibility level, defaults to 3 i.e. NTLMv2 only
    • isAllowNTLMFallback

      public boolean isAllowNTLMFallback()
      Description copied from interface: Configuration
      Property org.codelibs.jcifs.smb.impl.allowNTLMFallback (boolean, default true)
      Specified by:
      isAllowNTLMFallback in interface Configuration
      Returns:
      whether to allow fallback from kerberos to NTLM
    • isUseRawNTLM

      public boolean isUseRawNTLM()
      Description copied from interface: Configuration
      Property org.codelibs.jcifs.smb.impl.useRawNTLM (boolean, default false)
      Specified by:
      isUseRawNTLM in interface Configuration
      Returns:
      whether to use raw NTLMSSP tokens instead of SPNEGO wrapped ones
    • isDisableSpnegoIntegrity

      public boolean isDisableSpnegoIntegrity()
      Description copied from interface: Configuration
      Property org.codelibs.jcifs.smb.impl.client.disableSpnegoIntegrity (boolean, false)
      Specified by:
      isDisableSpnegoIntegrity in interface Configuration
      Returns:
      whether to disable sending/verifying SPNEGO mechanismListMIC
    • isEnforceSpnegoIntegrity

      public boolean isEnforceSpnegoIntegrity()
      Description copied from interface: Configuration
      Property org.codelibs.jcifs.smb.impl.client.enforceSpnegoIntegrity (boolean, false)
      Specified by:
      isEnforceSpnegoIntegrity in interface Configuration
      Returns:
      whether to enforce verifying SPNEGO mechanismListMIC
    • getBroadcastAddress

      public InetAddress getBroadcastAddress()
      Description copied from interface: Configuration
      Property org.codelibs.jcifs.smb.netbios.baddr (string, default 255.255.255.255)
      Specified by:
      getBroadcastAddress in interface Configuration
      Returns:
      broadcast address to use
    • getResolveOrder

      public List<ResolverType> getResolveOrder()
      Description copied from interface: Configuration
      Property org.codelibs.jcifs.smb.resolveOrder (string, default LMHOSTS,DNS,WINS,BCAST)
      Specified by:
      getResolveOrder in interface Configuration
      Returns:
      order and selection of resolver modules, see ResolverType
    • getWinsServers

      public InetAddress[] getWinsServers()
      Description copied from interface: Configuration
      Property org.codelibs.jcifs.smb.netbios.wins (string, comma separated)
      Specified by:
      getWinsServers in interface Configuration
      Returns:
      WINS server to use
    • getNetbiosLocalPort

      public int getNetbiosLocalPort()
      Description copied from interface: Configuration
      Property org.codelibs.jcifs.smb.netbios.lport (int)
      Specified by:
      getNetbiosLocalPort in interface Configuration
      Returns:
      local bind port for nebios connections
    • getNetbiosLocalAddress

      public InetAddress getNetbiosLocalAddress()
      Description copied from interface: Configuration
      Property org.codelibs.jcifs.smb.netbios.laddr (string)
      Specified by:
      getNetbiosLocalAddress in interface Configuration
      Returns:
      local bind address for netbios connections
    • getNetbiosSoTimeout

      public int getNetbiosSoTimeout()
      Description copied from interface: Configuration
      Property org.codelibs.jcifs.smb.netbios.soTimeout (int, default 5000)
      Specified by:
      getNetbiosSoTimeout in interface Configuration
      Returns:
      socket timeout for netbios connections, in milliseconds
    • getNetbiosScope

      public String getNetbiosScope()
      Description copied from interface: Configuration
      Property org.codelibs.jcifs.smb.netbios.scope (string)
      Specified by:
      getNetbiosScope in interface Configuration
      Returns:
      default netbios scope to set in requests
    • getNetbiosCachePolicy

      public int getNetbiosCachePolicy()
      Description copied from interface: Configuration
      Property org.codelibs.jcifs.smb.netbios.cachePolicy in minutes (int, default 600)
      Specified by:
      getNetbiosCachePolicy in interface Configuration
      Returns:
      netbios cache timeout, in seconds, 0 - disable caching, -1 - cache forever
    • getNetbiosRcvBufSize

      public int getNetbiosRcvBufSize()
      Description copied from interface: Configuration
      Property org.codelibs.jcifs.smb.netbios.rcv_buf_size (int, default 576)
      Specified by:
      getNetbiosRcvBufSize in interface Configuration
      Returns:
      netbios recieve buffer size
    • getNetbiosRetryCount

      public int getNetbiosRetryCount()
      Description copied from interface: Configuration
      Property org.codelibs.jcifs.smb.netbios.retryCount (int, default 2)
      Specified by:
      getNetbiosRetryCount in interface Configuration
      Returns:
      maximum number of retries for netbios requests
    • getNetbiosRetryTimeout

      public int getNetbiosRetryTimeout()
      Description copied from interface: Configuration
      Property org.codelibs.jcifs.smb.netbios.retryTimeout (int, default 3000)
      Specified by:
      getNetbiosRetryTimeout in interface Configuration
      Returns:
      timeout of retry requests, in milliseconds
    • getNetbiosSndBufSize

      public int getNetbiosSndBufSize()
      Description copied from interface: Configuration
      Property org.codelibs.jcifs.smb.netbios.snd_buf_size (int, default 576)
      Specified by:
      getNetbiosSndBufSize in interface Configuration
      Returns:
      netbios send buffer size
    • getLmHostsFileName

      public String getLmHostsFileName()
      Description copied from interface: Configuration
      Property org.codelibs.jcifs.smb.netbios.lmhosts (string)
      Specified by:
      getLmHostsFileName in interface Configuration
      Returns:
      lmhosts file to use
    • getFlags2

      public int getFlags2()
      Description copied from interface: Configuration
      Property org.codelibs.jcifs.smb.impl.client.flags2 (int)
      Specified by:
      getFlags2 in interface Configuration
      Returns:
      custom flags2
    • getSessionLimit

      public int getSessionLimit()
      Description copied from interface: Configuration
      Property org.codelibs.jcifs.smb.impl.client.ssnLimit (int, 250)
      Specified by:
      getSessionLimit in interface Configuration
      Returns:
      maximum number of sessions on a single connection
    • getOemEncoding

      public String getOemEncoding()
      Description copied from interface: Configuration
      Property org.codelibs.jcifs.smb.encoding (string, default Cp850)
      Specified by:
      getOemEncoding in interface Configuration
      Returns:
      OEM encoding to use
    • getLocalTimezone

      public TimeZone getLocalTimezone()
      Description copied from interface: Configuration
      Gets the local timezone for time-related operations
      Specified by:
      getLocalTimezone in interface Configuration
      Returns:
      local timezone
    • getPid

      public int getPid()
      Description copied from interface: Configuration
      Gets the process ID to use in SMB messages
      Specified by:
      getPid in interface Configuration
      Returns:
      Process id to send, randomized if unset
    • isSigningEnabled

      public boolean isSigningEnabled()
      Description copied from interface: Configuration
      Property org.codelibs.jcifs.smb.impl.client.signingPreferred (boolean, default false)
      Specified by:
      isSigningEnabled in interface Configuration
      Returns:
      whether to enable SMB signing (for everything), if available
    • isSigningEnforced

      public boolean isSigningEnforced()
      Description copied from interface: Configuration
      Property org.codelibs.jcifs.smb.impl.client.signingEnforced (boolean, default false)
      Specified by:
      isSigningEnforced in interface Configuration
      Returns:
      whether to enforce SMB signing (for everything)
    • isIpcSigningEnforced

      public boolean isIpcSigningEnforced()
      Description copied from interface: Configuration
      Property org.codelibs.jcifs.smb.impl.client.ipcSigningEnforced (boolean, default true)
      Specified by:
      isIpcSigningEnforced in interface Configuration
      Returns:
      whether to enforce SMB signing for IPC connections
    • isEncryptionEnabled

      public boolean isEncryptionEnabled()
      Description copied from interface: Configuration
      Property org.codelibs.jcifs.smb.impl.client.encryptionEnabled (boolean, default false) This is an experimental option allowing to indicate support during protocol negotiation, SMB encryption is not implemented yet.
      Specified by:
      isEncryptionEnabled in interface Configuration
      Returns:
      whether SMB encryption is enabled
    • isForceExtendedSecurity

      public boolean isForceExtendedSecurity()
      Description copied from interface: Configuration
      Property org.codelibs.jcifs.smb.impl.client.forceExtendedSecurity (boolean, default false)
      Specified by:
      isForceExtendedSecurity in interface Configuration
      Returns:
      whether to force extended security usage
    • getTransactionBufferSize

      public int getTransactionBufferSize()
      Description copied from interface: Configuration
      Property org.codelibs.jcifs.smb.impl.client.transaction_buf_size (int, default 65535)
      Specified by:
      getTransactionBufferSize in interface Configuration
      Returns:
      maximum data size for SMB transactions
    • getMaximumBufferSize

      public int getMaximumBufferSize()
      Description copied from interface: Configuration
      Gets the maximum buffer size for IO operations
      Specified by:
      getMaximumBufferSize in interface Configuration
      Returns:
      the maximum size of IO buffers, limits the maximum message size
    • getBufferCacheSize

      public int getBufferCacheSize()
      Description copied from interface: Configuration
      Property org.codelibs.jcifs.smb.impl.maxBuffers (int, default 16)
      Specified by:
      getBufferCacheSize in interface Configuration
      Returns:
      number of buffers to keep in cache
    • getListCount

      public int getListCount()
      Description copied from interface: Configuration
      Property org.codelibs.jcifs.smb.impl.client.listCount (int, default 200)
      Specified by:
      getListCount in interface Configuration
      Returns:
      maxmimum number of elements to request in a list request
    • getListSize

      public int getListSize()
      Description copied from interface: Configuration
      Property org.codelibs.jcifs.smb.impl.client.listSize (int, default 65435)
      Specified by:
      getListSize in interface Configuration
      Returns:
      maximum data size for list/info requests (known overhead is subtracted)
    • getAttributeCacheTimeout

      public long getAttributeCacheTimeout()
      Description copied from interface: Configuration
      Property org.codelibs.jcifs.smb.impl.client.attrExpirationPeriod (int, 5000)
      Specified by:
      getAttributeCacheTimeout in interface Configuration
      Returns:
      timeout of file attribute cache
    • isIgnoreCopyToException

      public boolean isIgnoreCopyToException()
      Description copied from interface: Configuration
      Property org.codelibs.jcifs.smb.impl.client.ignoreCopyToException (boolean, false)
      Specified by:
      isIgnoreCopyToException in interface Configuration
      Returns:
      whether to ignore exceptions that occur during file copy
    • getMaxRequestRetries

      public int getMaxRequestRetries()
      Description copied from interface: Configuration
      Property org.codelibs.jcifs.smb.impl.client.maxRequestRetries (int, default 2)
      Specified by:
      getMaxRequestRetries in interface Configuration
      Returns:
      retry SMB requests on failure up to n times
    • isTraceResourceUsage

      public boolean isTraceResourceUsage()
      Description copied from interface: Configuration
      This is solely intended for debugging
      Specified by:
      isTraceResourceUsage in interface Configuration
      Returns:
      whether to track the locations from which resources were created
    • isStrictResourceLifecycle

      public boolean isStrictResourceLifecycle()
      Description copied from interface: Configuration
      Property org.codelibs.jcifs.smb.impl.client.strictResourceLifecycle (bool, default false) If enabled, SmbFile instances starting with their first use will hold a reference to their tree. This means that trees/sessions/connections won't be idle-disconnected even if there are no other active references (currently executing code, file descriptors). Depending on the usage scenario, this may have some benefit as there won't be any delays for restablishing these resources, however comes at the cost of having to properly release all SmbFile instances you no longer need.
      Specified by:
      isStrictResourceLifecycle in interface Configuration
      Returns:
      whether to use strict resource lifecycle
    • isSendNTLMTargetName

      public boolean isSendNTLMTargetName()
      Description copied from interface: Configuration
      Property org.codelibs.jcifs.smb.impl.client.SendNTLMTargetName (boolean, true)
      Specified by:
      isSendNTLMTargetName in interface Configuration
      Returns:
      whether to send an AvTargetName with the NTLM exchange
    • getGuestUsername

      public String getGuestUsername()
      Description copied from interface: Configuration
      Property org.codelibs.jcifs.smb.impl.client.guestUsername, defaults to GUEST
      Specified by:
      getGuestUsername in interface Configuration
      Returns:
      username used when guest authentication is requested
    • getGuestPassword

      public String getGuestPassword()
      Description copied from interface: Configuration
      Property org.codelibs.jcifs.smb.impl.client.guestPassword, defaults to empty string
      Specified by:
      getGuestPassword in interface Configuration
      Returns:
      password used when guest authentication is requested
    • isAllowGuestFallback

      public boolean isAllowGuestFallback()
      Description copied from interface: Configuration
      Property org.codelibs.jcifs.smb.impl.client.allowGuestFallback, defaults to false
      Specified by:
      isAllowGuestFallback in interface Configuration
      Returns:
      whether to permit guest logins when user authentication is requested
    • getMachineId

      public byte[] getMachineId()
      Description copied from interface: Configuration
      Machine identifier ClientGuid, ... are derived from this value. Normally this should be randomly assigned for each client instance/configuration.
      Specified by:
      getMachineId in interface Configuration
      Returns:
      machine identifier (32 byte)
    • getBatchLimit

      public int getBatchLimit(String cmd)
      Gets the batch limit for a specific SMB command
      Specified by:
      getBatchLimit in interface Configuration
      Parameters:
      cmd - the SMB command name
      Returns:
      the batch limit for the given command
      See Also:
    • isAllowCompound

      public boolean isAllowCompound(String command)
      Checks if compound requests are allowed for the specified command
      Specified by:
      isAllowCompound in interface Configuration
      Parameters:
      command - the SMB command to check
      Returns:
      whether to allow creating compound requests with that command
      See Also:
    • doGetBatchLimit

      protected Integer doGetBatchLimit(String cmd)
      Gets the batch limit for a specific command
      Parameters:
      cmd - the command to get the batch limit for
      Returns:
      the batch limit for the command, or null if not set
    • initResolverOrder

      protected void initResolverOrder(String ro)
      Initializes the resolver order for name resolution.
      Parameters:
      ro - comma-separated list of resolver types (LMHOSTS, WINS, BCAST, DNS)
    • initProtocolVersions

      protected void initProtocolVersions(String minStr, String maxStr)
      Initializes the minimum and maximum protocol versions from string values.
      Parameters:
      minStr - string representation of minimum protocol version
      maxStr - string representation of maximum protocol version
    • initProtocolVersions

      protected void initProtocolVersions(DialectVersion min, DialectVersion max)
      Initializes the minimum and maximum protocol versions.
      Parameters:
      min - minimum protocol version
      max - maximum protocol version
    • initDisallowCompound

      protected void initDisallowCompound(String prop)
      Initializes the disallowed compound operations based on the provided property string.
      Parameters:
      prop - comma-separated list of operations to disallow in compound requests
    • initDefaults

      protected void initDefaults() throws CIFSException
      Initializes default configuration values. Sets up default values for various configuration parameters if not already specified.
      Throws:
      CIFSException - if there is an error during initialization