public class SafeBox extends Object
T-Plan Robot Enterprise, (C) 2009-2022 T-Plan Limited. All rights reserved.
Modifier and Type | Method and Description |
---|---|
void |
addChangeListener(ChangeListener l) |
void |
changePassword(String oldPass,
String newPass) |
void |
checkPassword() |
void |
checkPassword(String password) |
static boolean |
exists() |
Document |
getDocument(String name) |
List<String> |
getDocumentNames() |
static File |
getFile()
Get the safe box file.
|
static SafeBox |
getInstance() |
static SafeBox |
getInstance(File f)
Load the safe box from the specified file.
|
String |
getParameter(String name) |
List<String> |
getParameterNames() |
static boolean |
hasVariable(String variableName) |
boolean |
isEmpty() |
boolean |
isLocked() |
boolean |
isPasswordSet() |
void |
lock() |
void |
purge() |
void |
removeChangeListener(ChangeListener l) |
boolean |
removeDocument(String name) |
boolean |
removeParameter(String name) |
void |
save() |
void |
saveTo(File file)
Save the safe box to a custom file.
|
void |
setDocument(String name,
Document document) |
void |
setParameter(String name,
String value) |
void |
setPassword(String aPassword)
Set the safebox password.
|
public static SafeBox getInstance() throws IOException
IOException
public static SafeBox getInstance(File f) throws IOException
f
- an XML file containing safe box data.IOException
- on an I/O error.public void setPassword(String aPassword)
aPassword
- the password to set.public void addChangeListener(ChangeListener l)
public void removeChangeListener(ChangeListener l)
public boolean isPasswordSet()
public static boolean exists()
public static boolean hasVariable(String variableName)
public boolean isEmpty()
public void purge()
public void lock()
public void checkPassword(String password) throws IllegalArgumentException
IllegalArgumentException
public boolean isLocked()
public void checkPassword() throws IllegalArgumentException
IllegalArgumentException
public void setParameter(String name, String value) throws IllegalStateException
IllegalStateException
public String getParameter(String name) throws IllegalStateException
IllegalStateException
public boolean removeParameter(String name)
public boolean removeDocument(String name)
public void save() throws IOException, ParserConfigurationException, GeneralSecurityException
public void saveTo(File file) throws ParserConfigurationException, GeneralSecurityException, IOException
file
- a file to save the safe box to.ParserConfigurationException
- on an XML streaming error.GeneralSecurityException
- on a security error.IOException
- on an I/O error when writing to the target file.public void changePassword(String oldPass, String newPass) throws IllegalArgumentException, GeneralSecurityException, IOException
public static File getFile()