com.aptana.ide.core.ui
Class AptanaAuthenticator

java.lang.Object
  extended by java.net.Authenticator
      extended by com.aptana.ide.core.ui.UpdateManagerAuthenticator
          extended by com.aptana.ide.core.ui.AptanaAuthenticator

public class AptanaAuthenticator
extends UpdateManagerAuthenticator

Aptana authenticator


Nested Class Summary
 
Nested classes/interfaces inherited from class java.net.Authenticator
java.net.Authenticator.RequestorType
 
Constructor Summary
AptanaAuthenticator()
           
 
Method Summary
 void cacheAuthentication(java.lang.String hostString, java.net.PasswordAuthentication auth)
          Cache the authentication, without any processing.
static boolean cachingEnabled()
          Returns true if caching enable, false otherwise
 java.net.PasswordAuthentication encrypt(java.net.PasswordAuthentication auth)
          Takes in a PasswordAuthentication and returns one with an encrypted version of the password.
static java.net.PasswordAuthentication getCachedAuthentication(java.lang.String hostString)
          Gets the cached authentication
protected  java.net.PasswordAuthentication getPasswordAuthentication()
           
static java.util.Set getSavedHosts()
          Gets the saved hosts
static java.lang.String getUserName(java.lang.String hostString)
          Gets the user name for a host name
static boolean looksLikeCachedAreBad(java.lang.String hostString, java.lang.String serializedRequest)
          True is cached values appear to be bad
static void removeCachedAuthentication(java.lang.String hostname)
          Clears the saved credentials
static java.lang.String serializeRequest(java.lang.String hostString, java.lang.String prompt, java.lang.String protocol, java.lang.String scheme, int port, java.net.URL url)
          Serialize a request
 
Methods inherited from class java.net.Authenticator
getRequestingHost, getRequestingPort, getRequestingPrompt, getRequestingProtocol, getRequestingScheme, getRequestingSite, getRequestingURL, getRequestorType, requestPasswordAuthentication, requestPasswordAuthentication, requestPasswordAuthentication, setDefault
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AptanaAuthenticator

public AptanaAuthenticator()
Method Detail

getPasswordAuthentication

protected java.net.PasswordAuthentication getPasswordAuthentication()
Overrides:
getPasswordAuthentication in class UpdateManagerAuthenticator
See Also:
UpdateManagerAuthenticator.getPasswordAuthentication()

encrypt

public java.net.PasswordAuthentication encrypt(java.net.PasswordAuthentication auth)
Takes in a PasswordAuthentication and returns one with an encrypted version of the password. It will also strip the username to first 30 chars, and the password to first 20 of encrypted version.

Parameters:
auth - a PasswordAuthentication
Returns:
a PasswordAuthentication with trimmed username (30 chars) and trimmed, ecnrypted password (20 chars after encryption)

looksLikeCachedAreBad

public static boolean looksLikeCachedAreBad(java.lang.String hostString,
                                            java.lang.String serializedRequest)
True is cached values appear to be bad

Parameters:
hostString -
serializedRequest -
Returns:
- true if they look bad, false otherwise

serializeRequest

public static java.lang.String serializeRequest(java.lang.String hostString,
                                                java.lang.String prompt,
                                                java.lang.String protocol,
                                                java.lang.String scheme,
                                                int port,
                                                java.net.URL url)
Serialize a request

Parameters:
hostString -
prompt -
protocol -
scheme -
port -
url -
Returns:
- serialized request string

cachingEnabled

public static boolean cachingEnabled()
Returns true if caching enable, false otherwise

Returns:
- true if caching enabled

cacheAuthentication

public void cacheAuthentication(java.lang.String hostString,
                                java.net.PasswordAuthentication auth)
Cache the authentication, without any processing.

Parameters:
hostString -
auth -

getCachedAuthentication

public static java.net.PasswordAuthentication getCachedAuthentication(java.lang.String hostString)
Gets the cached authentication

Parameters:
hostString -
Returns:
- password authentication

getUserName

public static java.lang.String getUserName(java.lang.String hostString)
Gets the user name for a host name

Parameters:
hostString -
Returns:
- user name string

getSavedHosts

public static final java.util.Set getSavedHosts()
Gets the saved hosts

Returns:
- set of hosts

removeCachedAuthentication

public static void removeCachedAuthentication(java.lang.String hostname)
Clears the saved credentials

Parameters:
hostname - - host name