com.mucommander.auth
Class CredentialsMapping

java.lang.Object
  extended by com.mucommander.auth.CredentialsMapping

public final class CredentialsMapping
extends java.lang.Object

CredentialsMapping associates a Credentials instance with a 'realm' , that is the location to a server. It also adds the notion of persistency, allowing to specify whether the credentials should be saved to disk when the application quits and restored next time the application starts.

Author:
Maxence Bernard
See Also:
CredentialsManager

Constructor Summary
CredentialsMapping(Credentials credentials, FileURL realm, boolean isPersistent)
          Creates a new CredentialsMapping instance that associates the specified credentials with the given location.
 
Method Summary
 boolean equals(java.lang.Object o)
          Returns true if the given Object is a CredentialsMapping instance whose credentials and realm are equals to those of this instance.
 Credentials getCredentials()
          Returns the credentials.
 FileURL getRealm()
          Returns the location associated with the credentials.
 boolean isPersistent()
          Returns true if these credentials should be saved when the application terminates.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CredentialsMapping

public CredentialsMapping(Credentials credentials,
                          FileURL realm,
                          boolean isPersistent)
Creates a new CredentialsMapping instance that associates the specified credentials with the given location.

Parameters:
credentials - user credentials
realm - the location to associate the credentials with
isPersistent - if true, indicates to CredentialsManager that the credentials should be saved when the application terminates.
Method Detail

getCredentials

public Credentials getCredentials()
Returns the credentials.

Returns:
the credentials

getRealm

public FileURL getRealm()
Returns the location associated with the credentials.

Note: the returned FileURL does not contain any credentials.

Returns:
the location associated with the credentials.

isPersistent

public boolean isPersistent()
Returns true if these credentials should be saved when the application terminates.

Returns:
true if these credentials should be saved when the application terminates, false otherwise.

equals

public boolean equals(java.lang.Object o)
Returns true if the given Object is a CredentialsMapping instance whose credentials and realm are equals to those of this instance.

Overrides:
equals in class java.lang.Object
Parameters:
o - the Object to test for equality
Returns:
true if both CredentialsMapping instances are equal

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


This file is part of muCommander - Copyright (C) 2002-2008 Maxence Bernard