Map<URI, AttributeValue> resAttr;
try {
resAttr = ResourceAttributes.getResources(parts);
if (mimeType != null && !"".equals(mimeType)) {
resAttr.put(Constants.DATASTREAM.NEW_MIME_TYPE.getURI(),
new StringAttribute(mimeType));
}
if (formatURI != null && !"".equals(formatURI)) {
resAttr.put(Constants.DATASTREAM.NEW_FORMAT_URI.getURI(),
new AnyURIAttribute(new URI(formatURI)));
}
if (dsLocation != null && !"".equals(dsLocation)) {
resAttr.put(Constants.DATASTREAM.NEW_LOCATION.getURI(),
new AnyURIAttribute(new URI(dsLocation)));
}
if (checksumType != null && !"".equals(checksumType)) {
resAttr.put(Constants.DATASTREAM.NEW_CHECKSUM_TYPE.getURI(),
new StringAttribute(checksumType));
}
if (checksum != null && !"".equals(checksum)) {
resAttr.put(Constants.DATASTREAM.NEW_CHECKSUM.getURI(),
new StringAttribute(checksum));
}
String action = null;
if (dsLocation != null && !"".equals(dsLocation)) {
action =
Constants.ACTION.MODIFY_DATASTREAM_BY_REFERENCE
.getURI().toASCIIString();
} else {
action =
Constants.ACTION.MODIFY_DATASTREAM_BY_VALUE.getURI()
.toASCIIString();
}
actions.put(Constants.ACTION.ID.getURI(),
new StringAttribute(action));
actions.put(Constants.ACTION.API.getURI(),
Constants.ACTION.APIM.getStringAttribute());
// modifying the FeSL policy datastream requires policy management permissions
String dsID = parts[3];