else {
cpdUri = CUSTOM_CPD_PATH;
}
// read and parse the CPD
final PortletPublishingDefinition def;
final Resource cpdResource = this.resourceLoader.getResource("classpath:" + cpdUri);
if (!cpdResource.exists()) {
throw new MissingResourceException("Failed to find CPD '" + cpdUri + "' for channel type " + channelTypeId, this.getClass().getName(), cpdUri);
}
final InputStream cpdStream;
try {
cpdStream = cpdResource.getInputStream();
}
catch (IOException e) {
throw new MissingResourceException("Failed to load CPD '" + cpdUri + "' for channel type " + channelTypeId, this.getClass().getName(), cpdUri);
}
try {
def = (PortletPublishingDefinition) this.unmarshaller.unmarshal(cpdStream);
final List<Step> sharedParameters = this.getSharedParameters();
def.getSteps().addAll(sharedParameters);
// add the CPD to the cache and return it
this.cpdCache.put(channelTypeId, def);
return def;
} catch (JAXBException e) {