private void validateDomainOrInstance() throws CommandException, IOException {
// case 1: since ddp is specified - it MUST be a domain
if (userSpecifiedDomainDirParent != null) {
domainDirs = new DomainDirs(userSpecifiedDomainDirParent, userSpecifiedServerName);
}
//case 2: if either of these are set then it MUST be an instance
else if (userSpecifiedNode != null || userSpecifiedNodeDir != null) {
instanceDirs = new InstanceDirs(userSpecifiedNodeDir, userSpecifiedNode, userSpecifiedServerName);
}
// case 3: nothing is specified -- use default domain as in v3.0
else if (userSpecifiedServerName == null) {
domainDirs = new DomainDirs(userSpecifiedDomainDirParent, userSpecifiedServerName);
}
// case 4: userSpecifiedServerName is set and the other 3 are all null
// we need to figure out if it's a DAS or an instance
else {
try {
domainDirs = new DomainDirs(userSpecifiedDomainDirParent, userSpecifiedServerName);
return;
}
catch (IOException e) {
// handled below
}