3636@ RestController
3737public class GeneratorController {
3838
39+ public static final String ONTOLOGY_PATH_WITHOUT_SLASH = "ontology" ;
40+ public static final String ONTOLOGY_PATH = ONTOLOGY_PATH_WITHOUT_SLASH + "/" ;
41+
3942 private ApplicationContext applicationContext ;
4043 private FeatureParameterMapping featureMapping ;
4144 private StoredGenerationRepository repository ;
@@ -47,23 +50,23 @@ public GeneratorController(ApplicationContext applicationContext, FeatureParamet
4750 this .repository = repository ;
4851 }
4952
50- @ RequestMapping ("/ontology/" )
53+ @ RequestMapping (ONTOLOGY_PATH )
5154 public OWLOntology completeOntology (HttpServletResponse response ) throws OWLOntologyCreationException {
5255 return ontologyFromParameters (response , featureMapping .getAll ());
5356 }
5457
55- @ RequestMapping (value = "/ontology/" , params = "features" )
58+ @ RequestMapping (value = ONTOLOGY_PATH , params = "features" )
5659 public OWLOntology ontologyFromParameters (HttpServletResponse response , @ RequestParam ("features" ) List <Feature > features ) {
5760 return ontologyFromParametersWithFilename (response , features );
5861 }
5962
60- @ RequestMapping (value = "/ontology/ {filename}" , params = "features" , method = RequestMethod .GET )
63+ @ RequestMapping (value = ONTOLOGY_PATH + " {filename}" , params = "features" , method = RequestMethod .GET )
6164 public OWLOntology ontologyFromParametersWithFilename (HttpServletResponse response , @ RequestParam ("features" ) List <Feature > features ) {
6265 OntologyGenerator generator = applicationContext .getBean (OntologyGenerator .class );
6366 RequestInformation information = applicationContext .getBean (RequestInformation .class );
6467
6568 StoredGeneration generation = storeGenerationIfRequired (features );
66- response .addHeader ("Short-Path" , "/ontology/" + generation .getId () + "/" + generation .getId ());
69+ response .addHeader ("Short-Path" , "/" + ONTOLOGY_PATH + generation .getId () + "/" + generation .getId ());
6770
6871 information .setGenerationId (generation .getId ());
6972
@@ -87,12 +90,12 @@ private StoredGeneration storeGenerationIfRequired(List<Feature> features) {
8790 return generation ;
8891 }
8992
90- @ RequestMapping ("/ontology/ {id}/" )
93+ @ RequestMapping (ONTOLOGY_PATH + " {id}/" )
9194 public OWLOntology ontologyFromId (HttpServletResponse response , @ PathVariable ("id" ) Long id ) {
9295 return ontologyFromIdWithFilename (response , id );
9396 }
9497
95- @ RequestMapping ("/ontology/ {id}/{filename}" )
98+ @ RequestMapping (ONTOLOGY_PATH + " {id}/{filename}" )
9699 public OWLOntology ontologyFromIdWithFilename (HttpServletResponse response , @ PathVariable ("id" ) Long id ) {
97100 StoredGeneration storedGeneration = repository .findOne (id );
98101 if (storedGeneration == null ) {
0 commit comments