1 18 19 package jcifs.smb; 20 21 import jcifs.util.Hexdump; 22 23 public class SmbShareInfo implements FileEntry { 24 25 protected String netName; 26 protected int type; 27 protected String remark; 28 29 public String getName() { 30 return netName; 31 } 32 public int getType() { 33 35 switch (type & 0xFFFF) { 36 case 1: 37 return SmbFile.TYPE_PRINTER; 38 case 3: 39 return SmbFile.TYPE_NAMED_PIPE; 40 } 41 return SmbFile.TYPE_SHARE; 42 } 43 public int getAttributes() { 44 return SmbFile.ATTR_READONLY | SmbFile.ATTR_DIRECTORY; 45 } 46 public long createTime() { 47 return 0L; 48 } 49 public long lastModified() { 50 return 0L; 51 } 52 public long length() { 53 return 0L; 54 } 55 56 public boolean equals(Object obj) { 57 if (obj instanceof SmbShareInfo) { 58 SmbShareInfo si = (SmbShareInfo)obj; 59 return netName.equals(si.netName); 60 } 61 return false; 62 } 63 public int hashCode() { 64 int hashCode = netName.hashCode(); 65 return hashCode; 66 } 67 68 public String toString() { 69 return new String ( "SmbShareInfo[" + 70 "netName=" + netName + 71 ",type=0x" + Hexdump.toHexString( type, 8 ) + 72 ",remark=" + remark + "]" ); 73 } 74 } 75 | Popular Tags |