org.kohsuke.jnt
Class JavaNetRealm

java.lang.Object
  extended by org.kohsuke.jnt.JavaNetRealm

public class JavaNetRealm
extends Object

Cached authentication for java.net users.

A directory on a disk is used to cache users and their passwords.

Author:
Kohsuke Kawaguchi

Constructor Summary
JavaNetRealm(File root)
           
 
Method Summary
 boolean authenticate(String userName, String password)
          Authenticates the user.
 List<String> getAll()
          Gets all the users known thus far.
static String getDigestOf(InputStream source)
          Computes MD5 digest of the given input stream.
static String getDigestOf(String text)
           
 boolean hasUser(String userName)
          Returns true if the given user has successfully logged in in the past.
static String toHexString(byte[] bytes)
           
static String toHexString(byte[] data, int start, int len)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JavaNetRealm

public JavaNetRealm(File root)
Method Detail

getAll

public List<String> getAll()
Gets all the users known thus far.


hasUser

public boolean hasUser(String userName)
Returns true if the given user has successfully logged in in the past.


authenticate

public boolean authenticate(String userName,
                            String password)
                     throws IOException
Authenticates the user.

Throws:
IOException

getDigestOf

public static String getDigestOf(InputStream source)
                          throws IOException
Computes MD5 digest of the given input stream.

Parameters:
source - The stream will be closed by this method at the end of this method.
Returns:
32-char wide string
Throws:
IOException

getDigestOf

public static String getDigestOf(String text)

toHexString

public static String toHexString(byte[] data,
                                 int start,
                                 int len)

toHexString

public static String toHexString(byte[] bytes)


Copyright © 2003-2010 Kohsuke Kawaguchi. All Rights Reserved.