package org.gcube.informationsystem.publisher.scope; import java.util.List; import org.gcube.common.resources.gcore.Resource; public class DefaultScopeValidator implements Validator{ @Override public void validate(Resource resource) { if (resource.scopes().isEmpty()) throw new IllegalArgumentException("scopes in the resource are empty"); } @Override public void checkScopeCompatibility(Resource resource, List scopesList) { // for(String scope: scopesList){ // ScopeGroup scopes=resource.scopes(); // for(Iterator it=scopes.iterator(); it.hasNext();){ // String scopeItem=it.next(); // if((!scopeItem.contains(scope)) && (!scope.contains(scopeItem))) // throw new IllegalStateException("The scope "+scope+" is not compatible with scope: "+scopeItem+" that is present in the resource"+ resource.id()); // } // } } }