java.lang.Object
org.codelibs.jcifs.smb.config.BaseConfiguration
- All Implemented Interfaces:
Configuration
- Direct Known Subclasses:
PropertyConfiguration
Base implementation of CIFS configuration providing default settings and behavior.
Serves as the foundation for configuration implementations in the jCIFS library.
- Author:
- mbechler
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanWhether to allow fallback to guest authenticationprotected booleanWhether to allow fallback to NTLM authenticationprotected InetAddressBroadcast address for NetBIOS name resolutionprotected intNumber of buffers to keep in cacheprotected intSMB client capabilitiesprotected StringDefault domain for authenticationprotected StringDefault password for authenticationprotected StringDefault username for authenticationprotected booleanWhether to convert DFS paths to FQDNprotected booleanWhether DFS support is disabledprotected booleanWhether to use strict DFS path resolutionprotected longDFS cache time-to-live in secondsprotected booleanWhether plain text passwords are disabledprotected booleanWhether to disable SPNEGO integrity checkingSet of commands that should not be used in compound requestsprotected booleanWhether SMB3 encryption is enabledprotected booleanWhether to enforce SPNEGO integrity checkingprotected intSMB flags2 field valueprotected booleanForce use of extended security negotiationprotected booleanForce use of Unicode encoding regardless of negotiationprotected StringPassword for guest authenticationprotected StringUsername for guest authenticationprotected booleanWhether idle timeout is disabled for connectionsprotected booleanWhether to ignore exceptions during file copy operationsprotected booleanWhether to enforce signing for IPC connectionsprotected intLAN Manager compatibility level for authenticationprotected StringPath to lmhosts file for NetBIOS name resolutionprotected intLocal process ID for SMB messagesprotected TimeZoneLocal timezone for time calculationsprotected StringDefault logon shareprotected intMaximum buffer size for IO operationsprotected intMaximum multiplex count for concurrent requestsprotected intMaximum number of request retries on failureprotected DialectVersionMaximum SMB dialect version to negotiateprotected DialectVersionMinimum SMB dialect version to negotiateprotected StringNative LAN Manager string to reportprotected StringNative operating system name to reportprotected intNetBIOS name cache policy in secondsprotected StringNetBIOS hostnameprotected InetAddressLocal address for NetBIOS communicationsprotected intLocal port for NetBIOS communicationsprotected intNetBIOS retry countprotected intNetBIOS retry timeout in millisecondsprotected intNetBIOS receive buffer sizeprotected StringNetBIOS scope identifierprotected intNetBIOS send buffer sizeprotected intNetBIOS socket timeout in millisecondsprotected StringOEM encoding for non-Unicode operationsprotected booleanWhether to failover to port 139 if port 445 failsprotected booleanWhether to preserve share name case instead of converting to uppercaseprotected SecureRandomSecure random generator for cryptographic operationsprotected booleanWhether to require secure negotiate validationprotected List<ResolverType>Order of name resolution methods to useprotected booleanWhether to send NTLM target name during authenticationprotected intMaximum number of concurrent SMB sessionsprotected booleanWhether SMB signing is enforced (required)protected booleanWhether SMB signing is preferred but not requiredprotected booleanWhether to negotiate only SMB2 or higher protocolsprotected longTime in milliseconds before cached file attributes expireprotected intConnection timeout in milliseconds for establishing SMB connectionsprotected intMaximum number of entries to return in list operationsprotected intMaximum size for list operationsprotected InetAddressLocal address to bind for SMB connectionsprotected intLocal port to bind for SMB connectionsprotected intBuffer size for SMB notification operationsprotected intReceive buffer size for SMB socket operationsprotected intResponse timeout in milliseconds for SMB operationsprotected intSend buffer size for SMB socket operationsprotected intSession timeout in milliseconds for SMB sessionsprotected intSocket timeout in milliseconds for SMB connectionsprotected booleanWhether to disable Nagle's algorithm for TCP connectionsprotected booleanWhether to enforce strict resource lifecycle managementprotected booleanWhether to trace resource usage for debuggingprotected intMaximum buffer size for SMB transaction operationsprotected booleanWhether to use command batching for improved performanceprotected booleanWhether to use extended security negotiationprotected booleanWhether to use large read/write operations for better performanceprotected booleanWhether to use NT SMB operationsprotected booleanWhether to use NT status codes instead of DOS error codesprotected booleanWhether to use raw NTLM authentication without SPNEGOprotected booleanWhether to use Unicode encoding for stringsprotected intVirtual circuit number for SMB sessionsprotected InetAddress[]Array of WINS server addresses for NetBIOS name resolution -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedConstructs a BaseConfiguration with default settingsBaseConfiguration(boolean initDefaults) Constructs a BaseConfiguration with optional default initialization -
Method Summary
Modifier and TypeMethodDescriptionprotected IntegerdoGetBatchLimit(String cmd) Gets the batch limit for a specific commandlongPropertyorg.codelibs.jcifs.smb.impl.client.attrExpirationPeriod(int, 5000)intgetBatchLimit(String cmd) Gets the batch limit for a specific SMB commandPropertyorg.codelibs.jcifs.smb.netbios.baddr(string, default255.255.255.255)intPropertyorg.codelibs.jcifs.smb.impl.maxBuffers(int, default 16)intPropertyorg.codelibs.jcifs.smb.impl.client.capabilities(int)intPropertyorg.codelibs.jcifs.smb.impl.client.connTimeout(int, default 35000)Propertyorg.codelibs.jcifs.smb.impl.client.domainPropertyorg.codelibs.jcifs.smb.impl.client.passwordPropertyorg.codelibs.jcifs.smb.impl.client.usernamelongPropertyorg.codelibs.jcifs.smb.impl.client.dfs.ttl(int, default 300)intPropertyorg.codelibs.jcifs.smb.impl.client.flags2(int)Propertyorg.codelibs.jcifs.smb.impl.client.guestPassword, defaults to empty stringPropertyorg.codelibs.jcifs.smb.impl.client.guestUsername, defaults to GUESTintLanman compatibility level Microsoft TechNet Documentation LM Compatibility Levels 0 or 1 LM and NTLM 2 NTLM only 3-5 NTLMv2 only Propertyorg.codelibs.jcifs.smb.impl.lmCompatibility(int, default 3)intPropertyorg.codelibs.jcifs.smb.impl.client.listCount(int, default 200)intPropertyorg.codelibs.jcifs.smb.impl.client.listSize(int, default 65435)Propertyorg.codelibs.jcifs.smb.netbios.lmhosts(string)Propertyorg.codelibs.jcifs.smb.impl.client.laddr(string)intPropertyorg.codelibs.jcifs.smb.impl.client.lport(int)Gets the local timezone for time-related operationsPropertyorg.codelibs.jcifs.smb.impl.client.logonSharebyte[]Machine identifier ClientGuid, ... are derived from this value.intGets the maximum buffer size for IO operationsMaximum protocol version Propertyorg.codelibs.jcifs.smb.impl.client.maxVersion(string, default SMB210)intPropertyorg.codelibs.jcifs.smb.impl.client.maxMpxCount(int, default 10)intPropertyorg.codelibs.jcifs.smb.impl.client.maxRequestRetries(int, default 2)Minimum protocol version Propertyorg.codelibs.jcifs.smb.impl.client.minVersion(string, default SMB1)Propertyorg.codelibs.jcifs.smb.impl.client.nativeLanMan(string, defaultjCIFS)Propertyorg.codelibs.jcifs.smb.impl.client.nativeOs(string, defaultos.name)intPropertyorg.codelibs.jcifs.smb.netbios.cachePolicyin minutes (int, default 600)Propertyorg.codelibs.jcifs.smb.netbios.hostname(string)Propertyorg.codelibs.jcifs.smb.netbios.laddr(string)intPropertyorg.codelibs.jcifs.smb.netbios.lport(int)intPropertyorg.codelibs.jcifs.smb.netbios.rcv_buf_size(int, default 576)intPropertyorg.codelibs.jcifs.smb.netbios.retryCount(int, default 2)intPropertyorg.codelibs.jcifs.smb.netbios.retryTimeout(int, default 3000)Propertyorg.codelibs.jcifs.smb.netbios.scope(string)intPropertyorg.codelibs.jcifs.smb.netbios.snd_buf_size(int, default 576)intPropertyorg.codelibs.jcifs.smb.netbios.soTimeout(int, default 5000)intPropertyorg.codelibs.jcifs.smb.impl.client.notify_buf_size(int, default 1024)Propertyorg.codelibs.jcifs.smb.encoding(string, defaultCp850)intgetPid()Gets the process ID to use in SMB messagesGets the secure random number generator for cryptographic operationsintPropertyorg.codelibs.jcifs.smb.impl.client.rcv_buf_size(int, default 65535)intDeprecated.Propertyorg.codelibs.jcifs.smb.resolveOrder(string, defaultLMHOSTS,DNS,WINS,BCAST)intPropertyorg.codelibs.jcifs.smb.impl.client.responseTimeout(int, default 30000)intPropertyorg.codelibs.jcifs.smb.impl.client.snd_buf_size(int, default 65535)intPropertyorg.codelibs.jcifs.smb.impl.client.ssnLimit(int, 250)intPropertyorg.codelibs.jcifs.smb.impl.client.sessionTimeout(int, default 35000)intPropertyorg.codelibs.jcifs.smb.impl.client.soTimeout(int, default 35000)intPropertyorg.codelibs.jcifs.smb.impl.client.transaction_buf_size(int, default 65535)intGets the virtual circuit number for SMB connectionsPropertyorg.codelibs.jcifs.smb.netbios.wins(string, comma separated)protected voidInitializes default configuration values.protected voidinitDisallowCompound(String prop) Initializes the disallowed compound operations based on the provided property string.protected voidinitProtocolVersions(String minStr, String maxStr) Initializes the minimum and maximum protocol versions from string values.protected voidinitProtocolVersions(DialectVersion min, DialectVersion max) Initializes the minimum and maximum protocol versions.protected voidInitializes the resolver order for name resolution.booleanisAllowCompound(String command) Checks if compound requests are allowed for the specified commandbooleanPropertyorg.codelibs.jcifs.smb.impl.client.allowGuestFallback, defaults to falsebooleanPropertyorg.codelibs.jcifs.smb.impl.allowNTLMFallback(boolean, default true)booleanEnable 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.booleanPropertyorg.codelibs.jcifs.smb.impl.client.dfs.disabled(boolean, default false)booleanPropertyorg.codelibs.jcifs.smb.impl.client.dfs.strictView(boolean, default false)booleanPropertyorg.codelibs.jcifs.smb.impl.client.disablePlainTextPasswords(boolean, default true)booleanPropertyorg.codelibs.jcifs.smb.impl.client.disableSpnegoIntegrity(boolean, false)booleanPropertyorg.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.booleanPropertyorg.codelibs.jcifs.smb.impl.client.enforceSpnegoIntegrity(boolean, false)booleanPropertyorg.codelibs.jcifs.smb.impl.client.forceExtendedSecurity(boolean, default false)booleanPropertyorg.codelibs.jcifs.smb.impl.client.forceUnicode(boolean, default false)booleanPropertyorg.codelibs.jcifs.smb.impl.client.ignoreCopyToException(boolean, false)booleanPropertyorg.codelibs.jcifs.smb.impl.client.ipcSigningEnforced(boolean, default true)booleanEnable port 139 failover Propertyorg.codelibs.jcifs.smb.impl.client.port139.enabled(boolean, default false)booleanWhether to preserve share name case When true, preserve the original case of share names instead of converting to uppercase.booleanEnforce secure negotiation Propertyorg.codelibs.jcifs.smb.impl.client.requireSecureNegotiate(boolean, default true) This does not provide any actual downgrade protection if SMB1 is allowed.booleanPropertyorg.codelibs.jcifs.smb.impl.client.SendNTLMTargetName(boolean, true)booleanPropertyorg.codelibs.jcifs.smb.impl.client.signingPreferred(boolean, default false)booleanPropertyorg.codelibs.jcifs.smb.impl.client.signingEnforced(boolean, default false)booleanPropertyorg.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.booleanThis is solely intended for debuggingbooleanPropertyorg.codelibs.jcifs.smb.impl.client.useBatching(boolean, default false)booleanPropertyorg.codelibs.jcifs.smb.impl.useRawNTLM(boolean, default false)booleanUse SMB2 non-backward compatible negotiation style Propertyorg.codelibs.jcifs.smb.impl.client.useSMB2Negotiation(boolean, default false)booleanPropertyorg.codelibs.jcifs.smb.impl.client.useUnicode(boolean, default true)
-
Field Details
-
localPid
protected int localPidLocal process ID for SMB messages -
localTimeZone
Local timezone for time calculations -
random
Secure random generator for cryptographic operations -
useBatching
protected boolean useBatchingWhether to use command batching for improved performance -
useUnicode
protected boolean useUnicodeWhether to use Unicode encoding for strings -
forceUnicode
protected boolean forceUnicodeForce use of Unicode encoding regardless of negotiation -
signingPreferred
protected boolean signingPreferredWhether SMB signing is preferred but not required -
signingEnforced
protected boolean signingEnforcedWhether SMB signing is enforced (required) -
ipcSigningEnforced
protected boolean ipcSigningEnforcedWhether to enforce signing for IPC connections -
encryptionEnabled
protected boolean encryptionEnabledWhether SMB3 encryption is enabled -
useNtStatus
protected boolean useNtStatusWhether to use NT status codes instead of DOS error codes -
useExtendedSecurity
protected boolean useExtendedSecurityWhether to use extended security negotiation -
forceExtendedSecurity
protected boolean forceExtendedSecurityForce use of extended security negotiation -
smb2OnlyNegotiation
protected boolean smb2OnlyNegotiationWhether to negotiate only SMB2 or higher protocols -
port139FailoverEnabled
protected boolean port139FailoverEnabledWhether to failover to port 139 if port 445 fails -
useNTSmbs
protected boolean useNTSmbsWhether to use NT SMB operations -
useLargeReadWrite
protected boolean useLargeReadWriteWhether to use large read/write operations for better performance -
lanmanCompatibility
protected int lanmanCompatibilityLAN Manager compatibility level for authentication -
allowNTLMFallback
protected boolean allowNTLMFallbackWhether to allow fallback to NTLM authentication -
useRawNTLM
protected boolean useRawNTLMWhether to use raw NTLM authentication without SPNEGO -
disableSpnegoIntegrity
protected boolean disableSpnegoIntegrityWhether to disable SPNEGO integrity checking -
enforceSpnegoIntegrity
protected boolean enforceSpnegoIntegrityWhether to enforce SPNEGO integrity checking -
disablePlainTextPasswords
protected boolean disablePlainTextPasswordsWhether plain text passwords are disabled -
oemEncoding
OEM encoding for non-Unicode operations -
flags2
protected int flags2SMB flags2 field value -
capabilities
protected int capabilitiesSMB client capabilities -
sessionLimit
protected int sessionLimitMaximum number of concurrent SMB sessions -
smbTcpNoDelay
protected boolean smbTcpNoDelayWhether to disable Nagle's algorithm for TCP connections -
smbResponseTimeout
protected int smbResponseTimeoutResponse timeout in milliseconds for SMB operations -
smbSocketTimeout
protected int smbSocketTimeoutSocket timeout in milliseconds for SMB connections -
smbConnectionTimeout
protected int smbConnectionTimeoutConnection timeout in milliseconds for establishing SMB connections -
smbSessionTimeout
protected int smbSessionTimeoutSession timeout in milliseconds for SMB sessions -
idleTimeoutDisabled
protected boolean idleTimeoutDisabledWhether idle timeout is disabled for connections -
smbLocalAddress
Local address to bind for SMB connections -
smbLocalPort
protected int smbLocalPortLocal port to bind for SMB connections -
maxMpxCount
protected int maxMpxCountMaximum multiplex count for concurrent requests -
smbSendBufferSize
protected int smbSendBufferSizeSend buffer size for SMB socket operations -
smbRecvBufferSize
protected int smbRecvBufferSizeReceive buffer size for SMB socket operations -
smbNotifyBufferSize
protected int smbNotifyBufferSizeBuffer size for SMB notification operations -
nativeOs
Native operating system name to report -
nativeLanMan
Native LAN Manager string to report -
vcNumber
protected int vcNumberVirtual circuit number for SMB sessions -
dfsDisabled
protected boolean dfsDisabledWhether DFS support is disabled -
dfsTTL
protected long dfsTTLDFS cache time-to-live in seconds -
dfsStrictView
protected boolean dfsStrictViewWhether to use strict DFS path resolution -
dfsConvertToFqdn
protected boolean dfsConvertToFqdnWhether to convert DFS paths to FQDN -
defaultDomain
Default domain for authentication -
defaultUserName
Default username for authentication -
defaultPassword
Default password for authentication -
netbiosHostname
NetBIOS hostname -
netbiosCachePolicy
protected int netbiosCachePolicyNetBIOS name cache policy in seconds -
netbiosSocketTimeout
protected int netbiosSocketTimeoutNetBIOS socket timeout in milliseconds -
netbiosSendBufferSize
protected int netbiosSendBufferSizeNetBIOS send buffer size -
netbiosRevcBufferSize
protected int netbiosRevcBufferSizeNetBIOS receive buffer size -
netbiosRetryCount
protected int netbiosRetryCountNetBIOS retry count -
netbiosRetryTimeout
protected int netbiosRetryTimeoutNetBIOS retry timeout in milliseconds -
netbiosScope
NetBIOS scope identifier -
netbiosLocalPort
protected int netbiosLocalPortLocal port for NetBIOS communications -
netbiosLocalAddress
Local address for NetBIOS communications -
lmhostsFilename
Path to lmhosts file for NetBIOS name resolution -
winsServer
Array of WINS server addresses for NetBIOS name resolution -
broadcastAddress
Broadcast address for NetBIOS name resolution -
resolverOrder
Order of name resolution methods to use -
maximumBufferSize
protected int maximumBufferSizeMaximum buffer size for IO operations -
transactionBufferSize
protected int transactionBufferSizeMaximum buffer size for SMB transaction operations -
bufferCacheSize
protected int bufferCacheSizeNumber of buffers to keep in cache -
smbListSize
protected int smbListSizeMaximum size for list operations -
smbListCount
protected int smbListCountMaximum number of entries to return in list operations -
smbAttributeExpiration
protected long smbAttributeExpirationTime in milliseconds before cached file attributes expire -
ignoreCopyToException
protected boolean ignoreCopyToExceptionWhether to ignore exceptions during file copy operations -
maxRequestRetries
protected int maxRequestRetriesMaximum number of request retries on failure -
traceResourceUsage
protected boolean traceResourceUsageWhether to trace resource usage for debugging -
strictResourceLifecycle
protected boolean strictResourceLifecycleWhether to enforce strict resource lifecycle management -
disallowCompound
Set of commands that should not be used in compound requests -
minVersion
Minimum SMB dialect version to negotiate -
maxVersion
Maximum SMB dialect version to negotiate -
requireSecureNegotiate
protected boolean requireSecureNegotiateWhether to require secure negotiate validation -
sendNTLMTargetName
protected boolean sendNTLMTargetNameWhether to send NTLM target name during authentication -
guestUsername
Username for guest authentication -
guestPassword
Password for guest authentication -
allowGuestFallback
protected boolean allowGuestFallbackWhether to allow fallback to guest authentication
-
-
Constructor Details
-
BaseConfiguration
Constructs a BaseConfiguration with default settings- Throws:
CIFSException- if configuration initialization fails
-
BaseConfiguration
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
Description copied from interface:ConfigurationGets the secure random number generator for cryptographic operations- Specified by:
getRandomin interfaceConfiguration- Returns:
- random source to use
-
getNetbiosHostname
Description copied from interface:ConfigurationPropertyorg.codelibs.jcifs.smb.netbios.hostname(string)- Specified by:
getNetbiosHostnamein interfaceConfiguration- Returns:
- local NETBIOS/short name to announce
-
getLocalAddr
Description copied from interface:ConfigurationPropertyorg.codelibs.jcifs.smb.impl.client.laddr(string)- Specified by:
getLocalAddrin interfaceConfiguration- Returns:
- local address to use for outgoing connections
-
getLocalPort
public int getLocalPort()Description copied from interface:ConfigurationPropertyorg.codelibs.jcifs.smb.impl.client.lport(int)- Specified by:
getLocalPortin interfaceConfiguration- Returns:
- local port to use for outgoing connections
-
getConnTimeout
public int getConnTimeout()Description copied from interface:ConfigurationPropertyorg.codelibs.jcifs.smb.impl.client.connTimeout(int, default 35000)- Specified by:
getConnTimeoutin interfaceConfiguration- Returns:
- timeout for establishing a socket connection, in milliseconds
-
getResponseTimeout
public int getResponseTimeout()Description copied from interface:ConfigurationPropertyorg.codelibs.jcifs.smb.impl.client.responseTimeout(int, default 30000)- Specified by:
getResponseTimeoutin interfaceConfiguration- Returns:
- timeout for SMB responses, in milliseconds
-
getSoTimeout
public int getSoTimeout()Description copied from interface:ConfigurationPropertyorg.codelibs.jcifs.smb.impl.client.soTimeout(int, default 35000)- Specified by:
getSoTimeoutin interfaceConfiguration- Returns:
- socket timeout, in milliseconds
-
getSessionTimeout
public int getSessionTimeout()Description copied from interface:ConfigurationPropertyorg.codelibs.jcifs.smb.impl.client.sessionTimeout(int, default 35000)- Specified by:
getSessionTimeoutin interfaceConfiguration- Returns:
- timeout for SMB sessions, in milliseconds
-
getSendBufferSize
public int getSendBufferSize()Description copied from interface:ConfigurationPropertyorg.codelibs.jcifs.smb.impl.client.snd_buf_size(int, default 65535)- Specified by:
getSendBufferSizein interfaceConfiguration- Returns:
- send buffer size, in bytes
-
getRecieveBufferSize
Deprecated.Description copied from interface:ConfigurationPropertyorg.codelibs.jcifs.smb.impl.client.rcv_buf_size(int, default 65535)- Specified by:
getRecieveBufferSizein interfaceConfiguration- Returns:
- receive buffer size, in bytes
-
getReceiveBufferSize
public int getReceiveBufferSize()Description copied from interface:ConfigurationPropertyorg.codelibs.jcifs.smb.impl.client.rcv_buf_size(int, default 65535)- Specified by:
getReceiveBufferSizein interfaceConfiguration- Returns:
- receive buffer size, in bytes
-
getNotifyBufferSize
public int getNotifyBufferSize()Description copied from interface:ConfigurationPropertyorg.codelibs.jcifs.smb.impl.client.notify_buf_size(int, default 1024)- Specified by:
getNotifyBufferSizein interfaceConfiguration- Returns:
- the size of the requested server notify buffer
-
getMaxMpxCount
public int getMaxMpxCount()Description copied from interface:ConfigurationPropertyorg.codelibs.jcifs.smb.impl.client.maxMpxCount(int, default 10)- Specified by:
getMaxMpxCountin interfaceConfiguration- Returns:
- maximum count of concurrent commands to announce
-
getNativeLanman
Description copied from interface:ConfigurationPropertyorg.codelibs.jcifs.smb.impl.client.nativeLanMan(string, defaultjCIFS)- Specified by:
getNativeLanmanin interfaceConfiguration- Returns:
- Lanman string to report
-
getNativeOs
Description copied from interface:ConfigurationPropertyorg.codelibs.jcifs.smb.impl.client.nativeOs(string, defaultos.name)- Specified by:
getNativeOsin interfaceConfiguration- Returns:
- OS string to report
-
getVcNumber
public int getVcNumber()Description copied from interface:ConfigurationGets the virtual circuit number for SMB connections- Specified by:
getVcNumberin interfaceConfiguration- Returns:
- virtual circuit number to use
-
getCapabilities
public int getCapabilities()Description copied from interface:ConfigurationPropertyorg.codelibs.jcifs.smb.impl.client.capabilities(int)- Specified by:
getCapabilitiesin interfaceConfiguration- Returns:
- custom capabilities
-
getMinimumVersion
Description copied from interface:ConfigurationMinimum protocol version Propertyorg.codelibs.jcifs.smb.impl.client.minVersion(string, default SMB1)- Specified by:
getMinimumVersionin interfaceConfiguration- Returns:
- minimum protocol version to use/allow
- See Also:
-
getMaximumVersion
Description copied from interface:ConfigurationMaximum protocol version Propertyorg.codelibs.jcifs.smb.impl.client.maxVersion(string, default SMB210)- Specified by:
getMaximumVersionin interfaceConfiguration- Returns:
- maximum protocol version to use/allow
- See Also:
-
isUseSMB2OnlyNegotiation
public boolean isUseSMB2OnlyNegotiation()Description copied from interface:ConfigurationUse SMB2 non-backward compatible negotiation style Propertyorg.codelibs.jcifs.smb.impl.client.useSMB2Negotiation(boolean, default false)- Specified by:
isUseSMB2OnlyNegotiationin interfaceConfiguration- Returns:
- whether to use non-backward compatible protocol negotiation
-
isRequireSecureNegotiate
public boolean isRequireSecureNegotiate()Description copied from interface:ConfigurationEnforce secure negotiation Propertyorg.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:
isRequireSecureNegotiatein interfaceConfiguration- Returns:
- whether to enforce the use of secure negotiation.
-
isPort139FailoverEnabled
public boolean isPort139FailoverEnabled()Description copied from interface:ConfigurationEnable port 139 failover Propertyorg.codelibs.jcifs.smb.impl.client.port139.enabled(boolean, default false)- Specified by:
isPort139FailoverEnabledin interfaceConfiguration- Returns:
- whether to failover to legacy transport on port 139
-
isUseBatching
public boolean isUseBatching()Description copied from interface:ConfigurationPropertyorg.codelibs.jcifs.smb.impl.client.useBatching(boolean, default false)- Specified by:
isUseBatchingin interfaceConfiguration- Returns:
- whether to enable support for SMB1 AndX command batching
-
isUseUnicode
public boolean isUseUnicode()Description copied from interface:ConfigurationPropertyorg.codelibs.jcifs.smb.impl.client.useUnicode(boolean, default true)- Specified by:
isUseUnicodein interfaceConfiguration- Returns:
- whether to announce support for unicode
-
isForceUnicode
public boolean isForceUnicode()Description copied from interface:ConfigurationPropertyorg.codelibs.jcifs.smb.impl.client.forceUnicode(boolean, default false)- Specified by:
isForceUnicodein interfaceConfiguration- Returns:
- whether to use unicode, even if the server does not announce it
-
isDfsDisabled
public boolean isDfsDisabled()Description copied from interface:ConfigurationPropertyorg.codelibs.jcifs.smb.impl.client.dfs.disabled(boolean, default false)- Specified by:
isDfsDisabledin interfaceConfiguration- Returns:
- whether DFS lookup is disabled
-
isDfsStrictView
public boolean isDfsStrictView()Description copied from interface:ConfigurationPropertyorg.codelibs.jcifs.smb.impl.client.dfs.strictView(boolean, default false)- Specified by:
isDfsStrictViewin interfaceConfiguration- Returns:
- whether a authentication failure during DFS resolving will throw an exception
-
getDfsTtl
public long getDfsTtl()Description copied from interface:ConfigurationPropertyorg.codelibs.jcifs.smb.impl.client.dfs.ttl(int, default 300)- Specified by:
getDfsTtlin interfaceConfiguration- Returns:
- title to live, in seconds, for DFS cache entries
-
isDfsConvertToFQDN
public boolean isDfsConvertToFQDN()Description copied from interface:ConfigurationEnable 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. Propertyorg.codelibs.jcifs.smb.impl.client.dfs.convertToFQDN(boolean, default false)- Specified by:
isDfsConvertToFQDNin interfaceConfiguration- Returns:
- whether to convert NetBIOS names returned by DFS to FQDNs
-
getDefaultDomain
Description copied from interface:ConfigurationPropertyorg.codelibs.jcifs.smb.impl.client.domain- Specified by:
getDefaultDomainin interfaceConfiguration- Returns:
- default credentials, domain name
-
getDefaultUsername
Description copied from interface:ConfigurationPropertyorg.codelibs.jcifs.smb.impl.client.username- Specified by:
getDefaultUsernamein interfaceConfiguration- Returns:
- default credentials, user name
-
getDefaultPassword
Description copied from interface:ConfigurationPropertyorg.codelibs.jcifs.smb.impl.client.password- Specified by:
getDefaultPasswordin interfaceConfiguration- Returns:
- default credentials, password
-
isDisablePlainTextPasswords
public boolean isDisablePlainTextPasswords()Description copied from interface:ConfigurationPropertyorg.codelibs.jcifs.smb.impl.client.disablePlainTextPasswords(boolean, default true)- Specified by:
isDisablePlainTextPasswordsin interfaceConfiguration- Returns:
- whether the usage of plaintext passwords is prohibited, defaults to false
-
getLanManCompatibility
public int getLanManCompatibility()Description copied from interface:ConfigurationLanman compatibility level Microsoft TechNet Documentation
PropertyLM Compatibility Levels 0 or 1 LM and NTLM 2 NTLM only 3-5 NTLMv2 only org.codelibs.jcifs.smb.impl.lmCompatibility(int, default 3)- Specified by:
getLanManCompatibilityin interfaceConfiguration- Returns:
- lanman compatibility level, defaults to 3 i.e. NTLMv2 only
-
isAllowNTLMFallback
public boolean isAllowNTLMFallback()Description copied from interface:ConfigurationPropertyorg.codelibs.jcifs.smb.impl.allowNTLMFallback(boolean, default true)- Specified by:
isAllowNTLMFallbackin interfaceConfiguration- Returns:
- whether to allow fallback from kerberos to NTLM
-
isUseRawNTLM
public boolean isUseRawNTLM()Description copied from interface:ConfigurationPropertyorg.codelibs.jcifs.smb.impl.useRawNTLM(boolean, default false)- Specified by:
isUseRawNTLMin interfaceConfiguration- Returns:
- whether to use raw NTLMSSP tokens instead of SPNEGO wrapped ones
-
isDisableSpnegoIntegrity
public boolean isDisableSpnegoIntegrity()Description copied from interface:ConfigurationPropertyorg.codelibs.jcifs.smb.impl.client.disableSpnegoIntegrity(boolean, false)- Specified by:
isDisableSpnegoIntegrityin interfaceConfiguration- Returns:
- whether to disable sending/verifying SPNEGO mechanismListMIC
-
isEnforceSpnegoIntegrity
public boolean isEnforceSpnegoIntegrity()Description copied from interface:ConfigurationPropertyorg.codelibs.jcifs.smb.impl.client.enforceSpnegoIntegrity(boolean, false)- Specified by:
isEnforceSpnegoIntegrityin interfaceConfiguration- Returns:
- whether to enforce verifying SPNEGO mechanismListMIC
-
getBroadcastAddress
Description copied from interface:ConfigurationPropertyorg.codelibs.jcifs.smb.netbios.baddr(string, default255.255.255.255)- Specified by:
getBroadcastAddressin interfaceConfiguration- Returns:
- broadcast address to use
-
getResolveOrder
Description copied from interface:ConfigurationPropertyorg.codelibs.jcifs.smb.resolveOrder(string, defaultLMHOSTS,DNS,WINS,BCAST)- Specified by:
getResolveOrderin interfaceConfiguration- Returns:
- order and selection of resolver modules, see
ResolverType
-
getWinsServers
Description copied from interface:ConfigurationPropertyorg.codelibs.jcifs.smb.netbios.wins(string, comma separated)- Specified by:
getWinsServersin interfaceConfiguration- Returns:
- WINS server to use
-
getNetbiosLocalPort
public int getNetbiosLocalPort()Description copied from interface:ConfigurationPropertyorg.codelibs.jcifs.smb.netbios.lport(int)- Specified by:
getNetbiosLocalPortin interfaceConfiguration- Returns:
- local bind port for nebios connections
-
getNetbiosLocalAddress
Description copied from interface:ConfigurationPropertyorg.codelibs.jcifs.smb.netbios.laddr(string)- Specified by:
getNetbiosLocalAddressin interfaceConfiguration- Returns:
- local bind address for netbios connections
-
getNetbiosSoTimeout
public int getNetbiosSoTimeout()Description copied from interface:ConfigurationPropertyorg.codelibs.jcifs.smb.netbios.soTimeout(int, default 5000)- Specified by:
getNetbiosSoTimeoutin interfaceConfiguration- Returns:
- socket timeout for netbios connections, in milliseconds
-
getNetbiosScope
Description copied from interface:ConfigurationPropertyorg.codelibs.jcifs.smb.netbios.scope(string)- Specified by:
getNetbiosScopein interfaceConfiguration- Returns:
- default netbios scope to set in requests
-
getNetbiosCachePolicy
public int getNetbiosCachePolicy()Description copied from interface:ConfigurationPropertyorg.codelibs.jcifs.smb.netbios.cachePolicyin minutes (int, default 600)- Specified by:
getNetbiosCachePolicyin interfaceConfiguration- Returns:
- netbios cache timeout, in seconds, 0 - disable caching, -1 - cache forever
-
getNetbiosRcvBufSize
public int getNetbiosRcvBufSize()Description copied from interface:ConfigurationPropertyorg.codelibs.jcifs.smb.netbios.rcv_buf_size(int, default 576)- Specified by:
getNetbiosRcvBufSizein interfaceConfiguration- Returns:
- netbios recieve buffer size
-
getNetbiosRetryCount
public int getNetbiosRetryCount()Description copied from interface:ConfigurationPropertyorg.codelibs.jcifs.smb.netbios.retryCount(int, default 2)- Specified by:
getNetbiosRetryCountin interfaceConfiguration- Returns:
- maximum number of retries for netbios requests
-
getNetbiosRetryTimeout
public int getNetbiosRetryTimeout()Description copied from interface:ConfigurationPropertyorg.codelibs.jcifs.smb.netbios.retryTimeout(int, default 3000)- Specified by:
getNetbiosRetryTimeoutin interfaceConfiguration- Returns:
- timeout of retry requests, in milliseconds
-
getNetbiosSndBufSize
public int getNetbiosSndBufSize()Description copied from interface:ConfigurationPropertyorg.codelibs.jcifs.smb.netbios.snd_buf_size(int, default 576)- Specified by:
getNetbiosSndBufSizein interfaceConfiguration- Returns:
- netbios send buffer size
-
getLmHostsFileName
Description copied from interface:ConfigurationPropertyorg.codelibs.jcifs.smb.netbios.lmhosts(string)- Specified by:
getLmHostsFileNamein interfaceConfiguration- Returns:
- lmhosts file to use
-
getFlags2
public int getFlags2()Description copied from interface:ConfigurationPropertyorg.codelibs.jcifs.smb.impl.client.flags2(int)- Specified by:
getFlags2in interfaceConfiguration- Returns:
- custom flags2
-
getSessionLimit
public int getSessionLimit()Description copied from interface:ConfigurationPropertyorg.codelibs.jcifs.smb.impl.client.ssnLimit(int, 250)- Specified by:
getSessionLimitin interfaceConfiguration- Returns:
- maximum number of sessions on a single connection
-
getOemEncoding
Description copied from interface:ConfigurationPropertyorg.codelibs.jcifs.smb.encoding(string, defaultCp850)- Specified by:
getOemEncodingin interfaceConfiguration- Returns:
- OEM encoding to use
-
getLocalTimezone
Description copied from interface:ConfigurationGets the local timezone for time-related operations- Specified by:
getLocalTimezonein interfaceConfiguration- Returns:
- local timezone
-
getPid
public int getPid()Description copied from interface:ConfigurationGets the process ID to use in SMB messages- Specified by:
getPidin interfaceConfiguration- Returns:
- Process id to send, randomized if unset
-
isSigningEnabled
public boolean isSigningEnabled()Description copied from interface:ConfigurationPropertyorg.codelibs.jcifs.smb.impl.client.signingPreferred(boolean, default false)- Specified by:
isSigningEnabledin interfaceConfiguration- Returns:
- whether to enable SMB signing (for everything), if available
-
isSigningEnforced
public boolean isSigningEnforced()Description copied from interface:ConfigurationPropertyorg.codelibs.jcifs.smb.impl.client.signingEnforced(boolean, default false)- Specified by:
isSigningEnforcedin interfaceConfiguration- Returns:
- whether to enforce SMB signing (for everything)
-
isIpcSigningEnforced
public boolean isIpcSigningEnforced()Description copied from interface:ConfigurationPropertyorg.codelibs.jcifs.smb.impl.client.ipcSigningEnforced(boolean, default true)- Specified by:
isIpcSigningEnforcedin interfaceConfiguration- Returns:
- whether to enforce SMB signing for IPC connections
-
isEncryptionEnabled
public boolean isEncryptionEnabled()Description copied from interface:ConfigurationPropertyorg.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:
isEncryptionEnabledin interfaceConfiguration- Returns:
- whether SMB encryption is enabled
-
isForceExtendedSecurity
public boolean isForceExtendedSecurity()Description copied from interface:ConfigurationPropertyorg.codelibs.jcifs.smb.impl.client.forceExtendedSecurity(boolean, default false)- Specified by:
isForceExtendedSecurityin interfaceConfiguration- Returns:
- whether to force extended security usage
-
getTransactionBufferSize
public int getTransactionBufferSize()Description copied from interface:ConfigurationPropertyorg.codelibs.jcifs.smb.impl.client.transaction_buf_size(int, default 65535)- Specified by:
getTransactionBufferSizein interfaceConfiguration- Returns:
- maximum data size for SMB transactions
-
getMaximumBufferSize
public int getMaximumBufferSize()Description copied from interface:ConfigurationGets the maximum buffer size for IO operations- Specified by:
getMaximumBufferSizein interfaceConfiguration- Returns:
- the maximum size of IO buffers, limits the maximum message size
-
getBufferCacheSize
public int getBufferCacheSize()Description copied from interface:ConfigurationPropertyorg.codelibs.jcifs.smb.impl.maxBuffers(int, default 16)- Specified by:
getBufferCacheSizein interfaceConfiguration- Returns:
- number of buffers to keep in cache
-
getListCount
public int getListCount()Description copied from interface:ConfigurationPropertyorg.codelibs.jcifs.smb.impl.client.listCount(int, default 200)- Specified by:
getListCountin interfaceConfiguration- Returns:
- maxmimum number of elements to request in a list request
-
getListSize
public int getListSize()Description copied from interface:ConfigurationPropertyorg.codelibs.jcifs.smb.impl.client.listSize(int, default 65435)- Specified by:
getListSizein interfaceConfiguration- Returns:
- maximum data size for list/info requests (known overhead is subtracted)
-
getAttributeCacheTimeout
public long getAttributeCacheTimeout()Description copied from interface:ConfigurationPropertyorg.codelibs.jcifs.smb.impl.client.attrExpirationPeriod(int, 5000)- Specified by:
getAttributeCacheTimeoutin interfaceConfiguration- Returns:
- timeout of file attribute cache
-
isIgnoreCopyToException
public boolean isIgnoreCopyToException()Description copied from interface:ConfigurationPropertyorg.codelibs.jcifs.smb.impl.client.ignoreCopyToException(boolean, false)- Specified by:
isIgnoreCopyToExceptionin interfaceConfiguration- Returns:
- whether to ignore exceptions that occur during file copy
-
getMaxRequestRetries
public int getMaxRequestRetries()Description copied from interface:ConfigurationPropertyorg.codelibs.jcifs.smb.impl.client.maxRequestRetries(int, default 2)- Specified by:
getMaxRequestRetriesin interfaceConfiguration- Returns:
- retry SMB requests on failure up to n times
-
isTraceResourceUsage
public boolean isTraceResourceUsage()Description copied from interface:ConfigurationThis is solely intended for debugging- Specified by:
isTraceResourceUsagein interfaceConfiguration- Returns:
- whether to track the locations from which resources were created
-
isStrictResourceLifecycle
public boolean isStrictResourceLifecycle()Description copied from interface:ConfigurationPropertyorg.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:
isStrictResourceLifecyclein interfaceConfiguration- Returns:
- whether to use strict resource lifecycle
-
isSendNTLMTargetName
public boolean isSendNTLMTargetName()Description copied from interface:ConfigurationPropertyorg.codelibs.jcifs.smb.impl.client.SendNTLMTargetName(boolean, true)- Specified by:
isSendNTLMTargetNamein interfaceConfiguration- Returns:
- whether to send an AvTargetName with the NTLM exchange
-
getGuestUsername
Description copied from interface:ConfigurationPropertyorg.codelibs.jcifs.smb.impl.client.guestUsername, defaults to GUEST- Specified by:
getGuestUsernamein interfaceConfiguration- Returns:
- username used when guest authentication is requested
-
getGuestPassword
Description copied from interface:ConfigurationPropertyorg.codelibs.jcifs.smb.impl.client.guestPassword, defaults to empty string- Specified by:
getGuestPasswordin interfaceConfiguration- Returns:
- password used when guest authentication is requested
-
isAllowGuestFallback
public boolean isAllowGuestFallback()Description copied from interface:ConfigurationPropertyorg.codelibs.jcifs.smb.impl.client.allowGuestFallback, defaults to false- Specified by:
isAllowGuestFallbackin interfaceConfiguration- Returns:
- whether to permit guest logins when user authentication is requested
-
getMachineId
public byte[] getMachineId()Description copied from interface:ConfigurationMachine identifier ClientGuid, ... are derived from this value. Normally this should be randomly assigned for each client instance/configuration.- Specified by:
getMachineIdin interfaceConfiguration- Returns:
- machine identifier (32 byte)
-
getBatchLimit
Gets the batch limit for a specific SMB command- Specified by:
getBatchLimitin interfaceConfiguration- Parameters:
cmd- the SMB command name- Returns:
- the batch limit for the given command
- See Also:
-
isAllowCompound
Checks if compound requests are allowed for the specified command- Specified by:
isAllowCompoundin interfaceConfiguration- Parameters:
command- the SMB command to check- Returns:
- whether to allow creating compound requests with that command
- See Also:
-
doGetBatchLimit
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
Initializes the resolver order for name resolution.- Parameters:
ro- comma-separated list of resolver types (LMHOSTS, WINS, BCAST, DNS)
-
initProtocolVersions
Initializes the minimum and maximum protocol versions from string values.- Parameters:
minStr- string representation of minimum protocol versionmaxStr- string representation of maximum protocol version
-
initProtocolVersions
Initializes the minimum and maximum protocol versions.- Parameters:
min- minimum protocol versionmax- maximum protocol version
-
initDisallowCompound
Initializes the disallowed compound operations based on the provided property string.- Parameters:
prop- comma-separated list of operations to disallow in compound requests
-
initDefaults
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
-