Class PlainPasswordFile
- java.lang.Object
-
- com.netscape.cmsutil.password.PlainPasswordFile
-
- All Implemented Interfaces:
IPasswordStore
public class PlainPasswordFile extends java.lang.Object implements IPasswordStore
-
-
Constructor Summary
Constructors Constructor Description PlainPasswordFile()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcommit()java.lang.StringgetId()java.lang.StringgetPassword(java.lang.String tag, int iteration)intgetSize()java.util.Enumeration<java.lang.String>getTags()voidinit(java.lang.String pwdPath)Initialization method to read passwords(key and element pairs) from a file.java.lang.ObjectputPassword(java.lang.String tag, java.lang.String password)voidsetId(java.lang.String id)
-
-
-
Method Detail
-
init
public void init(java.lang.String pwdPath) throws java.io.IOExceptionInitialization method to read passwords(key and element pairs) from a file.Every property occupies one line of the input stream. Each line is terminated by a line terminator (
\nor\ror\r\n). Lines are processed until end of file is reached.A line that contains only whitespace or whose first non-whitespace character is an ASCII
#is ignored (thus,#indicates comment line).Every line other than a blank line or a comment line describes one property to be added to the table. The characters before the delimiter
=forms thekeyand the characters after the=is assigned asvalueto the key.As an example, each of the following lines specify the key
"Truth"and the associated element value"Beauty":Truth = Beauty Truth= Beauty Truth =Beauty
Note that the space appearing before/after
=is ignored. However, the space appearing in between are stored.Example:
Welcome Message = Hello World
assigns valueHello Worldto keyWelcome MessageIf the line doesn't have the delimiter
=, the method throws an IOException- Specified by:
initin interfaceIPasswordStore- Parameters:
pwdPath- the input file path.- Throws:
java.io.IOException- if an error occurred when reading from the input stream.
-
getPassword
public java.lang.String getPassword(java.lang.String tag, int iteration)- Specified by:
getPasswordin interfaceIPasswordStore
-
getTags
public java.util.Enumeration<java.lang.String> getTags()
- Specified by:
getTagsin interfaceIPasswordStore
-
putPassword
public java.lang.Object putPassword(java.lang.String tag, java.lang.String password)- Specified by:
putPasswordin interfaceIPasswordStore
-
commit
public void commit() throws java.io.IOException, java.lang.ClassCastException, java.lang.NullPointerException- Specified by:
commitin interfaceIPasswordStore- Throws:
java.io.IOExceptionjava.lang.ClassCastExceptionjava.lang.NullPointerException
-
getId
public java.lang.String getId()
-
setId
public void setId(java.lang.String id)
- Specified by:
setIdin interfaceIPasswordStore
-
getSize
public int getSize()
-
-