43 lines
1.5 KiB
Java
43 lines
1.5 KiB
Java
/**
|
|
* Created by IntelliJ IDEA.
|
|
* User: admin
|
|
* Date: Apr 19, 2005
|
|
* Time: 9:52:58 AM
|
|
* To change this template use Options | File Templates.
|
|
*/
|
|
package com.novell.casa;
|
|
|
|
public class MiCasaTest {
|
|
|
|
public static void main(String[] args)
|
|
{
|
|
MiCasa store = new MiCasa();
|
|
|
|
try {
|
|
store.setCredential(0, "JavaAppID", null, 0, "javaAppID Username", "javaAppID Password");
|
|
store.setCredential(0, "JavaAppID", "Network", 0, "javaAppID Username", "javaAppID Password");
|
|
store.setCredential(0, "Groupwise", null, 0, "groupwise Username", "gw Password");
|
|
|
|
NetCredential nc = store.getCredential(0, "JavaAppID", null, 0);
|
|
System.out.println("Username: "+nc.getUsername());
|
|
System.out.println("Password: "+nc.getPassword());
|
|
|
|
store.removeCredential(0, "Groupwise", null);
|
|
|
|
try {
|
|
nc = store.getCredential(0, "Groupwise", null, 0);
|
|
} catch (Exception e) {
|
|
e.printStackTrace(); //To change body of catch statement use Options | File Templates.
|
|
}
|
|
|
|
|
|
nc = store.getCredential(0, "nonexist2", null, 0);
|
|
System.out.println("Username: "+nc.getUsername());
|
|
System.out.println("Password: "+nc.getPassword());
|
|
|
|
} catch (Exception e) {
|
|
e.printStackTrace(); //To change body of catch statement use Options | File Templates.
|
|
}
|
|
}
|
|
}
|