Changed the way to read all contexts

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/private/luca.frosini/context-enumeration@167607 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Luca Frosini 2018-05-18 14:38:19 +00:00
parent 5ad8ce14d6
commit 993ce0c09b
5 changed files with 16 additions and 9 deletions

View File

@ -0,0 +1,6 @@
eclipse.preferences.version=1
encoding//src/main/java=UTF-8
encoding//src/main/resources=UTF-8
encoding//src/test/java=UTF-8
encoding//src/test/resources=UTF-8
encoding/<project>=UTF-8

View File

@ -0,0 +1,5 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.source=1.8

View File

@ -54,7 +54,7 @@
<dependency>
<groupId>org.gcube.portlets.admin</groupId>
<artifactId>rmp-common-library</artifactId>
<version>[2.7.1-SNAPSHOT,)</version>
<version>[2.7.2-SNAPSHOT, 3.0.0-SNAPSHOT)</version>
</dependency>
<dependency>

View File

@ -1,10 +1,9 @@
package org.gcube.context;
import java.io.File;
import java.util.LinkedHashMap;
import org.gcube.common.scope.impl.ScopeBean;
import org.gcube.resourcemanagement.support.server.managers.scope.ScopeManager;
import org.gcube.resourcemanagement.support.server.managers.context.ContextManager;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -19,10 +18,9 @@ public abstract class ContextElaborator {
}
public void all(File voFile) throws Exception{
public void all() throws Exception{
try {
LinkedHashMap<String, ScopeBean> map = ScopeManager.readScopes(voFile.getAbsolutePath());
LinkedHashMap<String,ScopeBean> map = ContextManager.readContexts();
for(String scope : map.keySet()) {
try {
String context = map.get(scope).toString();

View File

@ -12,12 +12,10 @@ public class TestContextList {
File test = new File(src, "test");
File resources = new File(test, "resources");
File voFile = new File(resources, "scopedata.xml");
File outputFile = new File(resources, "output.txt");
ContextList contextList = new ContextList(outputFile);
contextList.all(voFile);
contextList.all();
}