net.sf.fikin.ant.httpclientanttask
Class AntCredentials

java.lang.Object
  extended by net.sf.fikin.ant.httpclientanttask.AntCredentials

public class AntCredentials
extends java.lang.Object

Wraps up HttpClient credentials into an Ant tag

Example:

      <credentials type="basic" username="..." password="..." />
      
      <credentials type="basic" username="..." password="..." domain="ms" >
          <authscope ... />
      </credentials>
 
created on Feb 8, 2006

Version:
$Revision: 1.3 $
Author:
fiykov

Constructor Summary
AntCredentials()
           
 
Method Summary
 void check()
          check if type, username and passwords are set
 AntAuthScope createAuthScope()
          create new authentication scope
 org.apache.commons.httpclient.auth.AuthScope getAuthScope()
          get defined authentication scope
 org.apache.commons.httpclient.Credentials getCredentials()
          return the appropriate HttpClient object for given credentials
 java.lang.String getDomain()
          get authentication doamin
 java.lang.String getHost()
          get authentication host
 java.lang.String getPassword()
          get password used to authenticate the username
 java.lang.String getType()
          get http authentication type, by default it is "basic"
 java.lang.String getUsername()
          get authentication username
 void setDomain(java.lang.String domain)
          set the http authentication domain
 void setHost(java.lang.String host)
          authentication host
 void setPassword(java.lang.String pswd)
          set authentication password
 void setType(java.lang.String type)
          set http authentication type, by default it is "basic"
 void setUsername(java.lang.String username)
          set authentication user
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AntCredentials

public AntCredentials()
Method Detail

setType

public void setType(java.lang.String type)
set http authentication type, by default it is "basic"

Parameters:
type - is "baisc", "nt" and such
Ant Task Param Required:
false

getType

public java.lang.String getType()
get http authentication type, by default it is "basic"

Returns:
"basic", "nt" and such

setUsername

public void setUsername(java.lang.String username)
set authentication user

Parameters:
username - to use for authentication
Ant Task Param Required:
true

getUsername

public java.lang.String getUsername()
get authentication username

Returns:
username used to http authemticate or null if not set/needed

setPassword

public void setPassword(java.lang.String pswd)
set authentication password

Parameters:
pswd - to use for the http authentication
Ant Task Param Required:
true

getPassword

public java.lang.String getPassword()
get password used to authenticate the username

Returns:
password for the username or null if not set/needed

setDomain

public void setDomain(java.lang.String domain)
set the http authentication domain

Parameters:
domain - to set
Ant Task Param Required:
false

getDomain

public java.lang.String getDomain()
get authentication doamin

Returns:
domain used in the http authentication if set/needed

setHost

public void setHost(java.lang.String host)
authentication host

Parameters:
host - to set
Ant Task Param Required:
false

getHost

public java.lang.String getHost()
get authentication host

Returns:
host if set

createAuthScope

public AntAuthScope createAuthScope()
create new authentication scope

Returns:
aiuthentication scope
Ant Task Param Required:
false

check

public void check()
           throws org.apache.tools.ant.BuildException
check if type, username and passwords are set

Throws:
org.apache.tools.ant.BuildException

getCredentials

public org.apache.commons.httpclient.Credentials getCredentials()
return the appropriate HttpClient object for given credentials

Returns:
UsernamePasswordCredentials or NTCredentials

getAuthScope

public org.apache.commons.httpclient.auth.AuthScope getAuthScope()
get defined authentication scope

Returns:
authentication scope


Copyright © 2003-2007 Nikolay Fiykov. All Rights Reserved.