Fixed method that extarct the root scope from any scope

git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/application-support-layer/applicationSupportLayerSocial@141598 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Massimiliano Assante 2017-01-17 09:58:28 +00:00
parent 4ccc5b1ab5
commit 5bf6b8d078
1 changed files with 7 additions and 2 deletions

View File

@ -1,18 +1,23 @@
package org.gcube.applicationsupportlayer.social; package org.gcube.applicationsupportlayer.social;
import org.gcube.common.scope.impl.ScopeBean; import org.gcube.common.scope.impl.ScopeBean;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class ScopeBeanExt extends ScopeBean { public class ScopeBeanExt extends ScopeBean {
private static final Logger _log = LoggerFactory.getLogger(ScopeBeanExt.class);
private String context;
public ScopeBeanExt(String scope) throws IllegalArgumentException { public ScopeBeanExt(String scope) throws IllegalArgumentException {
super(scope); super(scope);
_log.trace("ScopeBeanExt instanciated with context " + scope);
this.context = scope;
} }
/** /**
* *
* @return the infrastructure scope e.g. /gcube * @return the infrastructure scope e.g. /gcube
*/ */
public String getInfrastructureScope() { public String getInfrastructureScope() {
String[] components = name().split(separator); String[] components = this.context.split(separator);
return separator+components[1]; return separator+components[1];
} }