boundedScopes = this.validateScopes(resStub.scopes().toArray(new String[0]));
@@ -545,8 +552,9 @@ public abstract class AbstractResourceManager {
try {
this.getRegistryPublisher().remove(resStub);
} catch (Exception e) {
-
+ ScopeProvider.instance.set(currScope);
}
+ ScopeProvider.instance.set(currScope);
}
}
diff --git a/src/main/java/org/gcube/resourcemanagement/support/server/managers/resources/GHNManager.java b/src/main/java/org/gcube/resourcemanagement/support/server/managers/resources/GHNManager.java
index 2c0fad5..0f94d78 100644
--- a/src/main/java/org/gcube/resourcemanagement/support/server/managers/resources/GHNManager.java
+++ b/src/main/java/org/gcube/resourcemanagement/support/server/managers/resources/GHNManager.java
@@ -131,7 +131,7 @@ public class GHNManager extends AbstractResourceManager {
}
return this.addToExistingScope(sourceScope, targetScope);
}
-
+
/**
*
* Required information:
diff --git a/src/main/java/org/gcube/resourcemanagement/support/server/utils/persistence/PersistentItem.java b/src/main/java/org/gcube/resourcemanagement/support/server/utils/persistence/PersistentItem.java
index 46cd3f2..89bcb47 100644
--- a/src/main/java/org/gcube/resourcemanagement/support/server/utils/persistence/PersistentItem.java
+++ b/src/main/java/org/gcube/resourcemanagement/support/server/utils/persistence/PersistentItem.java
@@ -129,7 +129,7 @@ implements PersistenceHandler {
while ((currLine = reader.readLine()) != null) {
xml.append(currLine);
}
-
+ reader.close();
return (T) this.getSerializer().fromXML(xml.toString());
} catch (Exception e) {
ServerConsole.error(LOG_PREFIX, e);