String location;
if (design.getName().startsWith(DESIGNNAMEPREFIX_ADDITIONALDIR)) {
String addName = design.getName().substring(DESIGNNAMEPREFIX_ADDITIONALDIR.length());
location = _additionalDirs.get(addName);
if (location == null) {
throw new WGADesignConfigurationException("Additional directory of name " + addName + " + is not defined");
}
} else if (design.getName().startsWith(DESIGNNAMEPREFIX_ARCHIVE)) {
FileObject designDir = WGUtils.resolveDirLink(_dir.getChild(design.getName().substring(DESIGNNAMEPREFIX_ARCHIVE.length()) + "." + ARCHIVED_DESIGN_EXTENSION));
if (designDir == null) {
throw new WGADesignConfigurationException("Archived design '" + _dir.resolveFile(design.getName()).getURL().toString() + " not found");
}
location = "zip:" + designDir.getURL().toString();
} else {
FileObject designDir = WGUtils.resolveDirLink(_dir.getChild(design.getName()));
if (designDir == null) {
throw new WGADesignConfigurationException("Design directory '" + _dir.resolveFile(design.getName()).getURL().toString() + " not found");
}
location = designDir.getURL().toString();
}
return location;
}