/** * {@inheritDoc} * * @see jcifs.Address#unwrap(java.lang.Class) */ @SuppressWarnings ( "unchecked" ) @Override public <T extends Address> T unwrap ( Class<T> type ) { if ( this.addr instanceof Address ) { return ( (Address) this.addr ).unwrap(type); } else if ( this.getClass().isAssignableFrom(type) ) { return (T) this; } return null; }
/** * {@inheritDoc} * * @see jcifs.Address#unwrap(java.lang.Class) */ @SuppressWarnings ( "unchecked" ) @Override public <T extends Address> T unwrap ( Class<T> type ) { if ( this.addr instanceof Address ) { return ( (Address) this.addr ).unwrap(type); } else if ( this.getClass().isAssignableFrom(type) ) { return (T) this; } return null; }
/** * {@inheritDoc} * * @see jcifs.SmbResourceLocator#isWorkgroup() */ @Override public boolean isWorkgroup () throws CIFSException { if ( this.type == SmbConstants.TYPE_WORKGROUP || this.url.getHost().length() == 0 ) { this.type = SmbConstants.TYPE_WORKGROUP; return true; } if ( getShare() == null ) { NetbiosAddress addr = getAddress().unwrap(NetbiosAddress.class); if ( addr != null ) { int code = addr.getNameType(); if ( code == 0x1d || code == 0x1b ) { this.type = SmbConstants.TYPE_WORKGROUP; return true; } } this.type = SmbConstants.TYPE_SERVER; } return false; }
/** * {@inheritDoc} * * @see jcifs.SmbResourceLocator#isWorkgroup() */ @Override public boolean isWorkgroup () throws CIFSException { if ( this.type == SmbConstants.TYPE_WORKGROUP || this.url.getHost().length() == 0 ) { this.type = SmbConstants.TYPE_WORKGROUP; return true; } if ( getShare() == null ) { NetbiosAddress addr = getAddress().unwrap(NetbiosAddress.class); if ( addr != null ) { int code = addr.getNameType(); if ( code == 0x1d || code == 0x1b ) { this.type = SmbConstants.TYPE_WORKGROUP; return true; } } this.type = SmbConstants.TYPE_SERVER; } return false; }
NetbiosAddress nbaddr = getAddress().unwrap(NetbiosAddress.class); if ( nbaddr != null ) { int code = nbaddr.getNameType();
NetbiosAddress nbaddr = getAddress().unwrap(NetbiosAddress.class); if ( nbaddr != null ) { int code = nbaddr.getNameType();