jcifs.Config.setProperty("jcifs.smb.client.responseTimeout", ConnectionUtil.getTimeout().toString()); jcifs.Config.setProperty("jcifs.smb.client.soTimeout", ConnectionUtil.getTimeout().toString()); jcifs.Config.registerSmbURLHandler();
/** * Returns the default flags for a generic Type-3 message in the * current environment. * * @param tc * context to use * @return An <code>int</code> containing the default flags. */ public static int getDefaultFlags ( CIFSContext tc ) { return NTLMSSP_NEGOTIATE_NTLM | NTLMSSP_NEGOTIATE_VERSION | ( tc.getConfig().isUseUnicode() ? NTLMSSP_NEGOTIATE_UNICODE : NTLMSSP_NEGOTIATE_OEM ); }
/** * * @param tc * @return address of active WINS server */ protected InetAddress getWINSAddress () { return this.transportContext.getConfig().getWinsServers().length == 0 ? null : this.transportContext.getConfig().getWinsServers()[ this.nbnsIndex ]; }
/** * Creates a Type-3 message using default values from the current * environment. * * @param tc * context to use */ public Type3Message ( CIFSContext tc ) { setFlags(getDefaultFlags(tc)); setDomain(tc.getConfig().getDefaultDomain()); setUser(tc.getConfig().getDefaultUsername()); setWorkstation(tc.getNameServiceClient().getLocalHost().getHostName()); }
/** * Creates a Type-1 message using default values from the current * environment. * * @param tc * context to use */ public Type1Message ( CIFSContext tc ) { this(tc, getDefaultFlags(tc), tc.getConfig().getDefaultDomain(), tc.getNameServiceClient().getLocalHost().getHostName()); }
/** * * {@inheritDoc} * * @see jcifs.smb.SmbResourceLocatorInternal#shouldForceSigning() */ @Override public boolean shouldForceSigning () { return this.ctx.getConfig().isIpcSigningEnforced() && !this.ctx.getCredentials().isAnonymous() && isIPC(); }
/** * * @param tc */ public NameServiceClientImpl ( CIFSContext tc ) { this(tc.getConfig().getNetbiosLocalPort(), tc.getConfig().getNetbiosLocalAddress(), tc); }
private static String getRPCTarget ( CIFSContext ctx, SmbResourceLocator loc, Address serverAddress ) { // Try to stick to the same server. However if we are using kerberos authentication we need to use the name. // The comment about composite share lists was wrong, we do not iterate over multiple targets. Credentials creds = ctx.getCredentials(); if ( creds instanceof Kerb5Authenticator && serverAddress.getHostName() != null ) { return serverAddress.getHostName(); } return serverAddress.getHostAddress(); }
void checkNodeStatusData ( CIFSContext tc ) throws UnknownHostException { if ( this.isDataFromNodeStatus == false ) { tc.getNameServiceClient().getNbtAllByAddress(this); } }
/** * Creates a Type-1 message using default values from the current * environment. * * @param tc * context to use */ public Type1Message ( CIFSContext tc ) { this(tc, getDefaultFlags(tc), tc.getConfig().getDefaultDomain(), tc.getNameServiceClient().getLocalHost().getHostName()); }
/** * Returns the default flags for a generic Type-2 message in the * current environment. * * @param tc * context to use * @return An <code>int</code> containing the default flags. */ public static int getDefaultFlags ( CIFSContext tc ) { return NTLMSSP_NEGOTIATE_NTLM | NTLMSSP_NEGOTIATE_VERSION | ( tc.getConfig().isUseUnicode() ? NTLMSSP_NEGOTIATE_UNICODE : NTLMSSP_NEGOTIATE_OEM ); }
/** * * @param tc */ public NameServiceClientImpl ( CIFSContext tc ) { this(tc.getConfig().getNetbiosLocalPort(), tc.getConfig().getNetbiosLocalAddress(), tc); }
private static String getRPCTarget ( CIFSContext ctx, SmbResourceLocator loc, Address serverAddress ) { // Try to stick to the same server. However if we are using kerberos authentication we need to use the name. // The comment about composite share lists was wrong, we do not iterate over multiple targets. Credentials creds = ctx.getCredentials(); if ( creds instanceof Kerb5Authenticator && serverAddress.getHostName() != null ) { return serverAddress.getHostName(); } return serverAddress.getHostAddress(); }
protected InetAddress switchWINS () { this.nbnsIndex = ( this.nbnsIndex + 1 ) < this.transportContext.getConfig().getWinsServers().length ? this.nbnsIndex + 1 : 0; return this.transportContext.getConfig().getWinsServers().length == 0 ? null : this.transportContext.getConfig().getWinsServers()[ this.nbnsIndex ]; }
void checkNodeStatusData ( CIFSContext tc ) throws UnknownHostException { if ( this.isDataFromNodeStatus == false ) { tc.getNameServiceClient().getNbtAllByAddress(this); } }
/** * Returns the default flags for a generic Type-1 message in the * current environment. * * @param tc * context to use * @return An <code>int</code> containing the default flags. */ public static int getDefaultFlags ( CIFSContext tc ) { return NTLMSSP_NEGOTIATE_NTLM | NTLMSSP_NEGOTIATE_VERSION | ( tc.getConfig().isUseUnicode() ? NTLMSSP_NEGOTIATE_UNICODE : NTLMSSP_NEGOTIATE_OEM ); }
protected InetAddress switchWINS () { this.nbnsIndex = ( this.nbnsIndex + 1 ) < this.transportContext.getConfig().getWinsServers().length ? this.nbnsIndex + 1 : 0; return this.transportContext.getConfig().getWinsServers().length == 0 ? null : this.transportContext.getConfig().getWinsServers()[ this.nbnsIndex ]; }
/** * Returns the default flags for a generic Type-1 message in the * current environment. * * @param tc * context to use * @return An <code>int</code> containing the default flags. */ public static int getDefaultFlags ( CIFSContext tc ) { return NTLMSSP_NEGOTIATE_NTLM | NTLMSSP_NEGOTIATE_VERSION | ( tc.getConfig().isUseUnicode() ? NTLMSSP_NEGOTIATE_UNICODE : NTLMSSP_NEGOTIATE_OEM ); }
/** * Returns the default flags for a generic Type-3 message in the * current environment. * * @param tc * context to use * @return An <code>int</code> containing the default flags. */ public static int getDefaultFlags ( CIFSContext tc ) { return NTLMSSP_NEGOTIATE_NTLM | NTLMSSP_NEGOTIATE_VERSION | ( tc.getConfig().isUseUnicode() ? NTLMSSP_NEGOTIATE_UNICODE : NTLMSSP_NEGOTIATE_OEM ); }
/** * Returns the default flags for a generic Type-2 message in the * current environment. * * @param tc * context to use * @return An <code>int</code> containing the default flags. */ public static int getDefaultFlags ( CIFSContext tc ) { return NTLMSSP_NEGOTIATE_NTLM | NTLMSSP_NEGOTIATE_VERSION | ( tc.getConfig().isUseUnicode() ? NTLMSSP_NEGOTIATE_UNICODE : NTLMSSP_NEGOTIATE_OEM ); }