Skip to content

Commit eebe377

Browse files
committed
issue #283
1 parent 1477174 commit eebe377

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

curation-web/src/main/java/eu/clarin/cmdi/curation/web/controller/CurateCtl.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import eu.clarin.cmdi.curation.cr.CRService;
1010
import eu.clarin.cmdi.curation.cr.exception.PPHCacheException;
1111
import eu.clarin.cmdi.curation.web.conf.WebConfig;
12+
import eu.clarin.cmdi.curation.web.exception.ProfileNotSupportedException;
1213
import lombok.extern.slf4j.Slf4j;
1314
import org.apache.commons.io.FileUtils;
1415
import org.apache.commons.lang.StringUtils;
@@ -190,8 +191,14 @@ private String createReport(Path inFilePath, Optional<String> format, Optional<S
190191

191192
if (text.contains("xmlns:xs=")) {// it's a profile
192193

194+
if(text.contains("http://www.clarin.eu/cmd/1")) {
193195

194196
report = curation.processCMDProfile(inFilePath.toUri().toString());
197+
}
198+
else {
199+
200+
throw new ProfileNotSupportedException();
201+
}
195202
}
196203
else { // no profile - so processed as CMD instance
197204

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
package eu.clarin.cmdi.curation.web.exception;
2+
3+
import org.springframework.http.HttpStatus;
4+
import org.springframework.web.bind.annotation.ResponseStatus;
5+
6+
@ResponseStatus(value = HttpStatus.BAD_REQUEST, reason = "Only CMDI 1.2 is supported")
7+
public class ProfileNotSupportedException extends RuntimeException {
8+
}

0 commit comments

Comments
 (0)