feature_24985 #15
|
@ -1122,7 +1122,7 @@ public class ProfiledMongoManager extends MongoManager implements MongoManagerI<
|
||||||
throws ConfigurationException, StorageHubException, JsonProcessingException, DeletionException,
|
throws ConfigurationException, StorageHubException, JsonProcessingException, DeletionException,
|
||||||
EventException, ProjectLockedException, ProjectNotFoundException, InvalidLockException,
|
EventException, ProjectLockedException, ProjectNotFoundException, InvalidLockException,
|
||||||
InvalidUserRoleException, UnauthorizedAccess {
|
InvalidUserRoleException, UnauthorizedAccess {
|
||||||
log.info("Deleting Fileset for {} [useCaseDescriptor ID {}], at {} [force {} and ignore_errors {}]", id,
|
log.info("Deleting Fileset for P_ID {} [UCD_ID {}], at {} [force {} and ignore_errors {}]", id,
|
||||||
useCaseDescriptor.getId(), path, force, ignore_errors);
|
useCaseDescriptor.getId(), path, force, ignore_errors);
|
||||||
Project doc = lock(id, "Fileset Deletion");
|
Project doc = lock(id, "Fileset Deletion");
|
||||||
try {
|
try {
|
||||||
|
@ -1263,22 +1263,37 @@ public class ProfiledMongoManager extends MongoManager implements MongoManagerI<
|
||||||
return doc;
|
return doc;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Updated by Francesco
|
// Changed by Francesco
|
||||||
RegisteredFileSet fs = null;
|
RegisteredFileSet fs = null;
|
||||||
|
error = null;
|
||||||
|
Exception theExc = null;
|
||||||
try {
|
try {
|
||||||
List<Object> deleteList = wrapper.getByPath(path);
|
List<Object> deleteList = wrapper.getByPath(path);
|
||||||
if (deleteList == null || deleteList.isEmpty()) {
|
if (deleteList == null || deleteList.isEmpty()) {
|
||||||
log.info("List of object going to delete is null or empty, retuning input doc");
|
error = "List of object going to delete is null or empty";
|
||||||
return doc;
|
log.info(error);
|
||||||
}
|
}
|
||||||
|
|
||||||
Object toFileSet = deleteList.get(0); // expected one
|
if (error == null) {
|
||||||
fs = Serialization.convert(toFileSet, RegisteredFileSet.class);
|
Object toFileSet = deleteList.get(0); // expected one
|
||||||
log.info("Going to delete {}", fs);
|
fs = Serialization.convert(toFileSet, RegisteredFileSet.class);
|
||||||
|
log.info("Going to delete {}", fs);
|
||||||
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.warn("Error on getting the RegisteredFileSet for path {}. Returning the input doc {}", path, doc.getId());
|
error = "Error on getting the RegisteredFileSet for path: " + path;
|
||||||
|
log.warn(error);
|
||||||
log.debug("Error is: ", e);
|
log.debug("Error is: ", e);
|
||||||
return doc;
|
theExc = e;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (error != null) {
|
||||||
|
if (ignore_errors) {
|
||||||
|
log.info("ignore_errors is {}, returning input doc {}", ignore_errors, doc.getId());
|
||||||
|
return doc;
|
||||||
|
}
|
||||||
|
log.info("Thrown "+ConfigurationException.class.getSimpleName()+" with message {}", theExc.getMessage());
|
||||||
|
throw new ConfigurationException(theExc.getMessage());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Updated by Francesco. See #24902
|
// Updated by Francesco. See #24902
|
||||||
|
|
Loading…
Reference in New Issue