1 17 package org.alfresco.filesys.server.auth.ntlm; 18 19 26 public class TargetInfo 27 { 28 30 private int m_type; 31 private String m_name; 32 33 39 public TargetInfo(int type, String name) 40 { 41 m_type = type; 42 m_name = name; 43 } 44 45 50 public final int isType() 51 { 52 return m_type; 53 } 54 55 60 public final String getName() 61 { 62 return m_name; 63 } 64 65 70 public String toString() 71 { 72 StringBuilder str = new StringBuilder (); 73 74 str.append("["); 75 str.append(getTypeAsString(isType())); 76 str.append(":"); 77 str.append(getName()); 78 str.append("]"); 79 80 return str.toString(); 81 } 82 83 89 public final static String getTypeAsString(int typ) 90 { 91 String typStr = null; 92 93 switch ( typ) 94 { 95 case NTLM.TargetServer: 96 typStr = "Server"; 97 break; 98 case NTLM.TargetDomain: 99 typStr = "Domain"; 100 break; 101 case NTLM.TargetFullDNS: 102 typStr = "DNS"; 103 break; 104 case NTLM.TargetDNSDomain: 105 typStr = "DNS Domain"; 106 break; 107 default: 108 typStr = "Unknown 0x" + Integer.toHexString(typ); 109 break; 110 } 111 112 return typStr; 113 } 114 } 115 | Popular Tags |