1 18 19 package jcifs.smb; 20 21 24 25 public abstract class NtlmAuthenticator { 26 27 private static NtlmAuthenticator auth; 28 29 private String url; 30 private SmbAuthException sae; 31 32 private void reset() { 33 url = null; 34 sae = null; 35 } 36 37 40 41 public synchronized static void setDefault( NtlmAuthenticator a ) { 42 if( auth != null ) { 43 return; 44 } 45 auth = a; 46 } 47 48 protected final String getRequestingURL() { 49 return url; 50 } 51 protected final SmbAuthException getRequestingException() { 52 return sae; 53 } 54 55 58 59 public static NtlmPasswordAuthentication 60 requestNtlmPasswordAuthentication( String url, SmbAuthException sae ) { 61 if( auth == null ) { 62 return null; 63 } 64 synchronized( auth ) { 65 auth.url = url; 66 auth.sae = sae; 67 return auth.getNtlmPasswordAuthentication(); 68 } 69 } 70 74 protected NtlmPasswordAuthentication getNtlmPasswordAuthentication() { 75 return null; 76 } 77 } 78 | Popular Tags |