1 17 package org.alfresco.filesys.netbios.win32; 18 19 import java.io.IOException ; 20 21 28 public class WinsockNetBIOSException extends IOException 29 { 30 private static final long serialVersionUID = 5933702607108016674L; 31 32 34 private int m_errCode; 35 36 39 public WinsockNetBIOSException() 40 { 41 super(); 42 } 43 44 49 public WinsockNetBIOSException(String msg) 50 { 51 super(msg); 52 53 55 if ( msg != null) 56 { 57 int pos = msg.indexOf(":"); 58 if ( pos != -1) 59 m_errCode = Integer.valueOf(msg.substring(0, pos)); 60 } 61 } 62 63 68 public WinsockNetBIOSException(int sts) 69 { 70 super(); 71 72 m_errCode = sts; 73 } 74 75 80 public final int getErrorCode() 81 { 82 return m_errCode; 83 } 84 85 90 public final void setErrorCode(int sts) 91 { 92 m_errCode = sts; 93 } 94 95 100 public String getMessage() 101 { 102 StringBuilder msg = new StringBuilder (); 103 104 msg.append( super.getMessage()); 105 String winsockErr = WinsockError.asString(getErrorCode()); 106 if ( winsockErr != null) 107 { 108 msg.append(" - "); 109 msg.append(winsockErr); 110 } 111 112 return msg.toString(); 113 } 114 } 115 | Popular Tags |