try
{
String drive = "C:";
String tempDirDomains = drive + "/tmp/domains";
String iasroot = drive + "/ee";
System.setProperty("com.sun.aas.instanceRoot", iasroot);
System.setProperty("com.sun.aas.domainsRoot", iasroot + "/domains");
System.setProperty("com.sun.aas.instanceName", "server");
System.setProperty("java.library.path", iasroot + "/bin");
System.setProperty("com.sun.aas.configRoot", iasroot + "/config" );
System.setProperty("java.endorsed.dirs", iasroot + "/lib/endorsed");
//System.setProperty("com.sun.appserv.admin.pluggable.features=com.sun.enterprise.ee.admin.pluggable.EEClientPluggableFeatureImpl
MyCLI cli = new MyCLI();
Enumeration urls = MyCLI.class.getClassLoader().getResources("CLIDescriptor.xml");
if ((urls == null) || (!urls.hasMoreElements()))
{
System.out.println("No URLS");
}
else
System.out.println(urls);
while (urls.hasMoreElements())
{
URL url = (URL) urls.nextElement();
System.out.println(url);
}
//String cmdline = "restore-domain --domaindir " + tempDirDomains
// + " domain1 ";
//String cmdline = "restore-domain --domaindir " + tempDirDomains
//+ " --filename C:/tmp/domains/domain1/backups/1080108915404.zip " + " domain23 ";
//String cmdline = "backup-domain --domaindir " + tempDirDomains + " domain1";
//String cmdline = "list-backups domain1";
String cmdline = "backup-domain domain1 --verbose --description foobarski";
//String cmdline = "restore-domain domain1";
System.out.println(cmdline);
CLIMain.invokeCLI(cmdline, InputsAndOutputs.getInstance());
}
catch(Exception e)
{
e.printStackTrace();
}