/** * Sets the time period during which attributes values (e.g. isDirectory, last modified, ...) are cached by * jcifs.smb.SmbFile. The higher this value, the lower the number of network requests but also the longer it takes * before those attributes can be refreshed. * * @param period time period during which attributes values are cached, in milliseconds */ public static void setAttributeCachingPeriod(long period) { jcifs.Config.setProperty("jcifs.smb.client.attrExpirationPeriod", ""+period); }
static void initDefaults() { if (DEFAULT_DOMAIN != null) return; DEFAULT_DOMAIN = Config.getProperty("jcifs.smb.client.domain", "?"); DEFAULT_USERNAME = Config.getProperty("jcifs.smb.client.username", "GUEST"); DEFAULT_PASSWORD = Config.getProperty("jcifs.smb.client.password", BLANK); }
SmbTransport(SmbComNegotiate nego, UniAddress address, int port, InetAddress localAddr, int localPort) { this.NEGOTIATE_REQUEST = nego; this.flags2 = NEGOTIATE_REQUEST.flags2; this.capabilities = Config.getInt("jcifs.smb.client.capabilities", DEFAULT_CAPABILITIES); // SmbAuthenticator<< this.address = address; this.port = port; this.localAddr = localAddr; this.localPort = localPort; }
jcifs.Config.setProperty("jcifs.smb.client.responseTimeout", ConnectionUtil.getTimeout().toString()); jcifs.Config.setProperty("jcifs.smb.client.soTimeout", ConnectionUtil.getTimeout().toString()); jcifs.Config.registerSmbURLHandler();
/** * Static configuration of the JCIFS library. * The log level of this class is mapped to a suitable <code>jcifs.util.loglevel</code> */ static void configureJcifs() { // TODO jcifs.Config.setProperty("jcifs.smb.client.useExtendedSecurity", "false"); // TODO jcifs.Config.setProperty("jcifs.smb.client.disablePlainTextPasswords", "false"); // set JCIFS SMB client library' log level unless already configured by system property final String sysPropLogLevel = "jcifs.util.loglevel"; if (jcifs.Config.getProperty(sysPropLogLevel) == null) { // set log level according to this class' logger's log level. Log log = LogFactory.getLog(SmbSession.class); if (log.isTraceEnabled()) { jcifs.Config.setProperty(sysPropLogLevel, "N"); } else if (log.isDebugEnabled()) { jcifs.Config.setProperty(sysPropLogLevel, "3"); } else { jcifs.Config.setProperty(sysPropLogLevel, "1"); } } }
Config.setProperty( "jcifs.smb.client.soTimeout", "1800000" ); Config.setProperty( "jcifs.netbios.cachePolicy", "1200" ); Config.setProperty( "jcifs.smb.lmCompatibility", "0" ); Config.setProperty( "jcifs.smb.client.useExtendedSecurity", "false" ); name = (String)e.nextElement(); if( name.startsWith( "jcifs." )) { Config.setProperty( name, filterConfig.getInitParameter( name )); defaultDomain = Config.getProperty("jcifs.smb.client.domain"); domainController = Config.getProperty( "jcifs.http.domainController" ); if( domainController == null ) { domainController = defaultDomain; loadBalance = Config.getBoolean( "jcifs.http.loadBalance", true ); Config.getProperty("jcifs.http.enableBasic")).booleanValue(); insecureBasic = Boolean.valueOf( Config.getProperty("jcifs.http.insecureBasic")).booleanValue(); realm = Config.getProperty("jcifs.http.basicRealm"); if (realm == null) realm = "jCIFS"; if(( level = Config.getInt( "jcifs.util.loglevel", -1 )) != -1 ) { LogStream.setLevel( level ); Config.store( log, "JCIFS PROPERTIES" ); } catch( IOException ioe ) {
public void init(ServletConfig config) throws ServletException { super.init(config); /* Set jcifs properties we know we want; soTimeout and cachePolicy to 10min. */ Config.setProperty( "jcifs.smb.client.soTimeout", "300000" ); Config.setProperty( "jcifs.netbios.cachePolicy", "600" ); Enumeration e = config.getInitParameterNames(); String name; while (e.hasMoreElements()) { name = (String) e.nextElement(); if (name.startsWith("jcifs.")) { Config.setProperty(name, config.getInitParameter(name)); } } defaultDomain = Config.getProperty("jcifs.smb.client.domain"); domainController = Config.getProperty("jcifs.http.domainController"); if( domainController == null ) { domainController = defaultDomain; loadBalance = Config.getBoolean( "jcifs.http.loadBalance", true ); } enableBasic = Boolean.valueOf( Config.getProperty("jcifs.http.enableBasic")).booleanValue(); insecureBasic = Boolean.valueOf( Config.getProperty("jcifs.http.insecureBasic")).booleanValue(); realm = Config.getProperty("jcifs.http.basicRealm"); if (realm == null) realm = "jCIFS"; }
this.useBatching = Config.getBoolean(p, "jcifs.smb.client.useBatching", true); this.useUnicode = Config.getBoolean(p, "jcifs.smb.client.useUnicode", true); this.useLargeReadWrite = Config.getBoolean(p, "jcifs.smb.client.useLargeReadWrite", true); this.forceUnicode = Config.getBoolean(p, "jcifs.smb.client.forceUnicode", false); this.signingPreferred = Config.getBoolean(p, "jcifs.smb.client.signingPreferred", false); this.signingEnforced = Config.getBoolean(p, "jcifs.smb.client.signingEnforced", false); this.ipcSigningEnforced = Config.getBoolean(p, "jcifs.smb.client.ipcSigningEnforced", true); this.encryptionEnabled = Config.getBoolean(p, "jcifs.smb.client.encryptionEnabled", false); this.lanmanCompatibility = Config.getInt(p, "jcifs.smb.lmCompatibility", 3); this.allowNTLMFallback = Config.getBoolean(p, "jcifs.smb.allowNTLMFallback", true); this.useRawNTLM = Config.getBoolean(p, "jcifs.smb.useRawNTLM", false); this.disableSpnegoIntegrity = Config.getBoolean(p, "jcifs.smb.client.disableSpnegoIntegrity", false); this.enforceSpnegoIntegrity = Config.getBoolean(p, "jcifs.smb.client.enforceSpnegoIntegrity", false); this.disablePlainTextPasswords = Config.getBoolean(p, "jcifs.smb.client.disablePlainTextPasswords", true); this.useNtStatus = Config.getBoolean(p, "jcifs.smb.client.useNtStatus", true); this.useExtendedSecurity = Config.getBoolean(p, "jcifs.smb.client.useExtendedSecurity", true); this.forceExtendedSecurity = Config.getBoolean(p, "jcifs.smb.client.forceExtendedSecurity", false); this.smb2OnlyNegotiation = Config.getBoolean(p, "jcifs.smb.client.useSMB2Negotiation", false); this.port139FailoverEnabled = Config.getBoolean(p, "jcifs.smb.client.port139.enabled", false); this.useNTSmbs = Config.getBoolean(p, "jcifs.smb.client.useNTSmbs", true); this.flags2 = Config.getInt(p, "jcifs.smb.client.flags2", 0);
if ( this.domainController == null ) { this.domainController = this.defaultDomain; this.loadBalance = Config.getBoolean(p, "jcifs.http.loadBalance", true); this.netbiosLookupRespLimit = Config.getInt(p, "jcifs.netbios.lookupRespLimit", 3); this.netbiosCacheTimeout = Config.getInt(p, "jcifs.netbios.cachePolicy", 60 * 10) * 60; /* 10 hours */
if ( this.domainController == null ) { this.domainController = this.defaultDomain; this.loadBalance = Config.getBoolean(p, "jcifs.http.loadBalance", true);
baddr = Config.getInetAddress( "jcifs.netbios.baddr", InetAddress.getByName( "255.255.255.255" )); } catch( UnknownHostException uhe ) {
Config.setProperty( "jcifs.smb.client.soTimeout", "1800000" ); Config.setProperty( "jcifs.netbios.cachePolicy", "1200" ); Config.setProperty( "jcifs.smb.lmCompatibility", "0" ); Config.setProperty( "jcifs.smb.client.useExtendedSecurity", "false" ); name = (String)e.nextElement(); if( name.startsWith( "jcifs." )) { Config.setProperty( name, filterConfig.getInitParameter( name )); defaultDomain = Config.getProperty("jcifs.smb.client.domain"); domainController = Config.getProperty( "jcifs.http.domainController" ); if( domainController == null ) { domainController = defaultDomain; loadBalance = Config.getBoolean( "jcifs.http.loadBalance", true ); Config.getProperty("jcifs.http.enableBasic")).booleanValue(); insecureBasic = Boolean.valueOf( Config.getProperty("jcifs.http.insecureBasic")).booleanValue(); realm = Config.getProperty("jcifs.http.basicRealm"); if (realm == null) realm = "jCIFS"; if(( level = Config.getInt( "jcifs.util.loglevel", -1 )) != -1 ) { LogStream.setLevel( level ); Config.store( log, "JCIFS PROPERTIES" ); } catch( IOException ioe ) {
public void init(ServletConfig config) throws ServletException { super.init(config); /* Set jcifs properties we know we want; soTimeout and cachePolicy to 10min. */ Config.setProperty( "jcifs.smb.client.soTimeout", "300000" ); Config.setProperty( "jcifs.netbios.cachePolicy", "600" ); Enumeration e = config.getInitParameterNames(); String name; while (e.hasMoreElements()) { name = (String) e.nextElement(); if (name.startsWith("jcifs.")) { Config.setProperty(name, config.getInitParameter(name)); } } defaultDomain = Config.getProperty("jcifs.smb.client.domain"); domainController = Config.getProperty("jcifs.http.domainController"); if( domainController == null ) { domainController = defaultDomain; loadBalance = Config.getBoolean( "jcifs.http.loadBalance", true ); } enableBasic = Boolean.valueOf( Config.getProperty("jcifs.http.enableBasic")).booleanValue(); insecureBasic = Boolean.valueOf( Config.getProperty("jcifs.http.insecureBasic")).booleanValue(); realm = Config.getProperty("jcifs.http.basicRealm"); if (realm == null) realm = "jCIFS"; }
this.useBatching = Config.getBoolean(p, "jcifs.smb.client.useBatching", true); this.useUnicode = Config.getBoolean(p, "jcifs.smb.client.useUnicode", true); this.useLargeReadWrite = Config.getBoolean(p, "jcifs.smb.client.useLargeReadWrite", true); this.forceUnicode = Config.getBoolean(p, "jcifs.smb.client.forceUnicode", false); this.signingPreferred = Config.getBoolean(p, "jcifs.smb.client.signingPreferred", false); this.signingEnforced = Config.getBoolean(p, "jcifs.smb.client.signingEnforced", false); this.ipcSigningEnforced = Config.getBoolean(p, "jcifs.smb.client.ipcSigningEnforced", true); this.encryptionEnabled = Config.getBoolean(p, "jcifs.smb.client.encryptionEnabled", false); this.lanmanCompatibility = Config.getInt(p, "jcifs.smb.lmCompatibility", 3); this.allowNTLMFallback = Config.getBoolean(p, "jcifs.smb.allowNTLMFallback", true); this.useRawNTLM = Config.getBoolean(p, "jcifs.smb.useRawNTLM", false); this.disableSpnegoIntegrity = Config.getBoolean(p, "jcifs.smb.client.disableSpnegoIntegrity", false); this.enforceSpnegoIntegrity = Config.getBoolean(p, "jcifs.smb.client.enforceSpnegoIntegrity", false); this.disablePlainTextPasswords = Config.getBoolean(p, "jcifs.smb.client.disablePlainTextPasswords", true); this.useNtStatus = Config.getBoolean(p, "jcifs.smb.client.useNtStatus", true); this.useExtendedSecurity = Config.getBoolean(p, "jcifs.smb.client.useExtendedSecurity", true); this.forceExtendedSecurity = Config.getBoolean(p, "jcifs.smb.client.forceExtendedSecurity", false); this.smb2OnlyNegotiation = Config.getBoolean(p, "jcifs.smb.client.useSMB2Negotiation", false); this.port139FailoverEnabled = Config.getBoolean(p, "jcifs.smb.client.port139.enabled", false); this.useNTSmbs = Config.getBoolean(p, "jcifs.smb.client.useNTSmbs", true); this.flags2 = Config.getInt(p, "jcifs.smb.client.flags2", 0);
jcifs.Config.registerSmbURLHandler(); jcifs.Config.setProperty("jcifs.util.loglevel", "4");
if ( this.domainController == null ) { this.domainController = this.defaultDomain; this.loadBalance = Config.getBoolean(p, "jcifs.http.loadBalance", true); this.netbiosLookupRespLimit = Config.getInt(p, "jcifs.netbios.lookupRespLimit", 3); this.netbiosCacheTimeout = Config.getInt(p, "jcifs.netbios.cachePolicy", 60 * 10) * 60; /* 10 hours */
if ( this.domainController == null ) { this.domainController = this.defaultDomain; this.loadBalance = Config.getBoolean(p, "jcifs.http.loadBalance", true);
baddr = Config.getInetAddress( "jcifs.netbios.baddr", InetAddress.getByName( "255.255.255.255" )); } catch( UnknownHostException uhe ) {
Config.setProperty( "jcifs.smb.client.soTimeout", "1800000" ); Config.setProperty( "jcifs.netbios.cachePolicy", "1200" ); Config.setProperty( "jcifs.smb.lmCompatibility", "0" ); Config.setProperty( "jcifs.smb.client.useExtendedSecurity", "false" ); name = (String)e.nextElement(); if( name.startsWith( "jcifs." )) { Config.setProperty( name, filterConfig.getInitParameter( name )); defaultDomain = Config.getProperty("jcifs.smb.client.domain"); domainController = Config.getProperty( "jcifs.http.domainController" ); if( domainController == null ) { domainController = defaultDomain; loadBalance = Config.getBoolean( "jcifs.http.loadBalance", true ); Config.getProperty("jcifs.http.enableBasic")).booleanValue(); insecureBasic = Boolean.valueOf( Config.getProperty("jcifs.http.insecureBasic")).booleanValue(); realm = Config.getProperty("jcifs.http.basicRealm"); if (realm == null) realm = "jCIFS"; if(( level = Config.getInt( "jcifs.util.loglevel", -1 )) != -1 ) { LogStream.setLevel( level ); Config.store( log, "JCIFS PROPERTIES" ); } catch( IOException ioe ) {
public void init(ServletConfig config) throws ServletException { super.init(config); /* Set jcifs properties we know we want; soTimeout and cachePolicy to 10min. */ Config.setProperty( "jcifs.smb.client.soTimeout", "300000" ); Config.setProperty( "jcifs.netbios.cachePolicy", "600" ); Enumeration e = config.getInitParameterNames(); String name; while (e.hasMoreElements()) { name = (String) e.nextElement(); if (name.startsWith("jcifs.")) { Config.setProperty(name, config.getInitParameter(name)); } } defaultDomain = Config.getProperty("jcifs.smb.client.domain"); domainController = Config.getProperty("jcifs.http.domainController"); if( domainController == null ) { domainController = defaultDomain; loadBalance = Config.getBoolean( "jcifs.http.loadBalance", true ); } enableBasic = Boolean.valueOf( Config.getProperty("jcifs.http.enableBasic")).booleanValue(); insecureBasic = Boolean.valueOf( Config.getProperty("jcifs.http.insecureBasic")).booleanValue(); realm = Config.getProperty("jcifs.http.basicRealm"); if (realm == null) realm = "jCIFS"; }