}
return new Resource[] { buildOutputResource( resource, theory ) };
}
private Resource buildOutputResource( Resource resource, String theory ) {
ByteArrayResource byteArrayResource = new ByteArrayResource( theory.getBytes() );
byteArrayResource.setResourceType( ResourceType.PMML );
if ( resource.getSourcePath() != null ) {
String originalPath = resource.getSourcePath();
int start = originalPath.lastIndexOf( File.separator );
byteArrayResource.setSourcePath( "generated-sources/" + originalPath.substring( start ) + ".pmml" );
} else {
byteArrayResource.setSourcePath( "generated-sources/" + helper.getContext() + ".pmml" );
}
return byteArrayResource;
}