boolean isLatest,
OutputStream out) throws IOException {
PackageItem item = null;
if ( isLatest ) {
item = repository.loadPackage( packageName );
ContentPackageAssembler asm = new ContentPackageAssembler( item,
false );
String drl = asm.getDRL();
out.write( drl.getBytes() );
out.flush();
return packageName + ".drl";
} else {
item = repository.loadPackageSnapshot( packageName,
packageVersion );
ContentPackageAssembler asm = new ContentPackageAssembler( item,
false );
String drl = asm.getDRL();
out.write( drl.getBytes() );
out.flush();
return packageName + "_" + URLEncoder.encode( packageVersion,
"UTF-8" ) + ".drl";
}