2017-03-24 17:38:36 +01:00
|
|
|
/**
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
package org.gcube.datatransfer.resolver.scope;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The Class ScopeUtil.
|
|
|
|
*
|
2018-11-05 15:45:31 +01:00
|
|
|
* @author Francesco Mangiacrapa at ISTI-CNR (francesco.mangiacrapa@isti.cnr.it)
|
|
|
|
* Nov 5, 2018
|
2017-03-24 17:38:36 +01:00
|
|
|
*/
|
|
|
|
public class ScopeUtil {
|
|
|
|
|
2018-10-31 18:23:31 +01:00
|
|
|
public static final String SCOPE_SEPARATOR = "|";
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Normalize scope.
|
|
|
|
* Add the '/' as prefix and remove all '|'
|
|
|
|
* @param scope the scope
|
|
|
|
* @return the normalized scope
|
|
|
|
*/
|
|
|
|
public static String normalizeScope(String scope){
|
|
|
|
if(!scope.startsWith("/"))
|
|
|
|
scope="/"+scope;
|
|
|
|
scope = scope.replaceAll("\\"+SCOPE_SEPARATOR, "/");
|
|
|
|
return scope;
|
|
|
|
}
|
2017-03-24 17:38:36 +01:00
|
|
|
}
|