URLEncoder.encode(packageName, GuvnorHelper.ENCODING) + "/assets/";
load = helper.createGetMethod(loadUrl);
load.addRequestHeader("Accept", "application/xml");
helper.setAuth(client, load);
client.executeMethod(load);
PackageAssetsDTO dto = helper.jaxbTransformation(PackageAssetsDTO.class,
load.getResponseBodyAsStream(),
PackageAssetsDTO.class, PackageAssetDTO.class, MetaDataDTO.class);
List<PackageAssetDTO> validAssets = new ArrayList<PackageAssetDTO>();
if (fileType != null && !"".equals(fileType)) {
for (PackageAssetDTO asset : dto.getAsset()) {
if (asset.getMetadata().getFormat().equals(fileType)) {
validAssets.add(asset);
}
}
} else {
validAssets.addAll(dto.getAsset());
}
List<String> retval = new ArrayList<String>();
for (PackageAssetDTO asset : validAssets) {
String refLink = asset.getRefLink();
String fileName = refLink.substring(refLink.lastIndexOf('/') + 1);