com.izforge.izpack.util.os.unix
Class UnixUser

java.lang.Object
  extended by com.izforge.izpack.util.os.unix.UnixUser

public class UnixUser
extends java.lang.Object

This represents a Unix User. If initialized via fromEtcPasswdLine(), the users Name, home, uid, gid, and shell can be asked.

Author:
marc.eppelmann@reddot.de

Field Summary
private  java.lang.String itsDescription
          internal itsDescription
private  java.lang.String itsGid
          internal itsGid
private  java.lang.String itsHome
          internal itsHome
private  java.lang.String itsId
          internal itsId
private  java.lang.String itsName
          internal itsName
private  java.lang.String itsPasswdDigest
          internal itsPasswdDigest
private  java.lang.String itsShell
          internal itsShell
 
Constructor Summary
UnixUser()
           
 
Method Summary
 UnixUser fromEtcPasswdLine(java.lang.String anEtcPasswdLine)
          Parses a Line from /etc/passwd and stores each :token: in their field of the user.
 java.lang.String getDescription()
          Gets the Description aka Full Name
 java.lang.String getGid()
          Gtes the Users Group ID
 java.lang.String getHome()
          Gets the Users Home Directory
 java.lang.String getId()
          Gets the Users UID
 java.lang.String getName()
          Gets the Users Login Name
 java.lang.String getPasswdDigest()
          Gets the users passwd Digest or X if hidden in /etc/shadow
 java.lang.String getShell()
          Gets the users default Login-Shell
static void main(java.lang.String[] args)
          Static Test Main
 java.lang.String toString()
          Dumps the USer fields
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

itsName

private java.lang.String itsName
internal itsName


itsPasswdDigest

private java.lang.String itsPasswdDigest
internal itsPasswdDigest


itsId

private java.lang.String itsId
internal itsId


itsGid

private java.lang.String itsGid
internal itsGid


itsDescription

private java.lang.String itsDescription
internal itsDescription


itsHome

private java.lang.String itsHome
internal itsHome


itsShell

private java.lang.String itsShell
internal itsShell

Constructor Detail

UnixUser

public UnixUser()
Method Detail

getName

public java.lang.String getName()
Gets the Users Login Name

Returns:
the users login Name

getPasswdDigest

public java.lang.String getPasswdDigest()
Gets the users passwd Digest or X if hidden in /etc/shadow

Returns:
the passwdDigest or x

getId

public java.lang.String getId()
Gets the Users UID

Returns:
The Uid

getGid

public java.lang.String getGid()
Gtes the Users Group ID

Returns:
the gid

getDescription

public java.lang.String getDescription()
Gets the Description aka Full Name

Returns:
the users descriptio or full name

getHome

public java.lang.String getHome()
Gets the Users Home Directory

Returns:
the users home dir

getShell

public java.lang.String getShell()
Gets the users default Login-Shell

Returns:
The login shell or /bin/false for system users

fromEtcPasswdLine

public UnixUser fromEtcPasswdLine(java.lang.String anEtcPasswdLine)
Parses a Line from /etc/passwd and stores each :token: in their field of the user. Sample Line from /etc/passwd "eppelmann.local:x:900:100:Marc Eppelmann:/mnt/local/home/eppelmann.local:/bin/bash"

Parameters:
anEtcPasswdLine - A Passwd Line of the User.
Returns:
The filled User

toString

public java.lang.String toString()
Dumps the USer fields

Overrides:
toString in class java.lang.Object
Returns:
The User representation as String

main

public static void main(java.lang.String[] args)
Static Test Main

Parameters:
args -