try {
resAttr = ResourceAttributes.getResources(pid);
if (dsID != null && !"".equals(dsID)) {
resAttr.put(Constants.DATASTREAM.ID.getURI(),
new StringAttribute(dsID));
}
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 (controlGroup != null && !"".equals(controlGroup)) {
resAttr.put(Constants.DATASTREAM.NEW_CONTROL_GROUP.getURI(),
new StringAttribute(controlGroup));
}
if (dsState != null && !"".equals(dsState)) {
resAttr.put(Constants.DATASTREAM.NEW_STATE.getURI(),
new StringAttribute(dsState));
}
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));
}
actions.put(Constants.ACTION.ID.getURI(),
Constants.ACTION.ADD_DATASTREAM
.getStringAttribute());