/** * Guess first called name to try for session establishment. This * method is used exclusively by the <tt>jcifs.smb</tt> package. */ public String firstCalledName() { if( addr instanceof NbtAddress ) { return ((NbtAddress)addr).firstCalledName(); } else { calledName = ((InetAddress)addr).getHostName(); if( isDotQuadIP( calledName )) { calledName = NbtAddress.SMBSERVER_NAME; } else { int i = calledName.indexOf( '.' ); if( i > 1 && i < 15 ) { calledName = calledName.substring( 0, i ).toUpperCase(); } else if( calledName.length() > 15 ) { calledName = NbtAddress.SMBSERVER_NAME; } else { calledName = calledName.toUpperCase(); } } } return calledName; }
/** * Guess first called name to try for session establishment. This * method is used exclusively by the <tt>jcifs.smb</tt> package. */ public String firstCalledName() { if( addr instanceof NbtAddress ) { return ((NbtAddress)addr).firstCalledName(); } else { calledName = ((InetAddress)addr).getHostName(); if( isDotQuadIP( calledName )) { calledName = NbtAddress.SMBSERVER_NAME; } else { int i = calledName.indexOf( '.' ); if( i > 1 && i < 15 ) { calledName = calledName.substring( 0, i ).toUpperCase(); } else if( calledName.length() > 15 ) { calledName = NbtAddress.SMBSERVER_NAME; } else { calledName = calledName.toUpperCase(); } } } return calledName; }
/** * Guess first called name to try for session establishment. This * method is used exclusively by the <tt>jcifs.smb</tt> package. */ public String firstCalledName() { if( addr instanceof NbtAddress ) { return ((NbtAddress)addr).firstCalledName(); } else { calledName = ((InetAddress)addr).getHostName(); if( isDotQuadIP( calledName )) { calledName = NbtAddress.SMBSERVER_NAME; } else { int i = calledName.indexOf( '.' ); if( i > 1 && i < 15 ) { calledName = calledName.substring( 0, i ).toUpperCase(); } else if( calledName.length() > 15 ) { calledName = NbtAddress.SMBSERVER_NAME; } else { calledName = calledName.toUpperCase(); } } } return calledName; }
/** * Guess first called name to try for session establishment. This * method is used exclusively by the <tt>jcifs.smb</tt> package. */ public String firstCalledName() { if( addr instanceof NbtAddress ) { return ((NbtAddress)addr).firstCalledName(); } else { calledName = ((InetAddress)addr).getHostName(); if( isDotQuadIP( calledName )) { calledName = NbtAddress.SMBSERVER_NAME; } else { int i = calledName.indexOf( '.' ); if( i > 1 && i < 15 ) { calledName = calledName.substring( 0, i ).toUpperCase(); } else if( calledName.length() > 15 ) { calledName = NbtAddress.SMBSERVER_NAME; } else { calledName = calledName.toUpperCase(); } } } return calledName; }
/** * Guess first called name to try for session establishment. This * method is used exclusively by the <tt>jcifs.smb</tt> package. * * @return the guessed name */ @Override public String firstCalledName () { if ( this.addr instanceof NbtAddress ) { return ( (NbtAddress) this.addr ).firstCalledName(); } this.calledName = ( (InetAddress) this.addr ).getHostName(); if ( isDotQuadIP(this.calledName) ) { this.calledName = NbtAddress.SMBSERVER_NAME; } else { int i = this.calledName.indexOf('.'); if ( i > 1 && i < 15 ) { this.calledName = this.calledName.substring(0, i).toUpperCase(); } else if ( this.calledName.length() > 15 ) { this.calledName = NbtAddress.SMBSERVER_NAME; } else { this.calledName = this.calledName.toUpperCase(); } } return this.calledName; }
/** * Guess first called name to try for session establishment. This * method is used exclusively by the <tt>jcifs.smb</tt> package. * * @return the guessed name */ @Override public String firstCalledName () { if ( this.addr instanceof NbtAddress ) { return ( (NbtAddress) this.addr ).firstCalledName(); } this.calledName = ( (InetAddress) this.addr ).getHostName(); if ( isDotQuadIP(this.calledName) ) { this.calledName = NbtAddress.SMBSERVER_NAME; } else { int i = this.calledName.indexOf('.'); if ( i > 1 && i < 15 ) { this.calledName = this.calledName.substring(0, i).toUpperCase(); } else if ( this.calledName.length() > 15 ) { this.calledName = NbtAddress.SMBSERVER_NAME; } else { this.calledName = this.calledName.toUpperCase(); } } return this.calledName; }