Github user rvesse commented on a diff in the pull request:

    https://github.com/apache/jena/pull/433#discussion_r194342614
  
    --- Diff: 
jena-fuseki2/jena-fuseki-core/src/main/java/org/apache/jena/fuseki/mgt/ActionDatasets.java
 ---
    @@ -351,15 +356,13 @@ private static void assemblerFromForm(HttpAction 
action, StreamRDF dest) {
             FusekiSystem.addGlobals(params); 
             
             //action.log.info(format("[%d] Create database : name = %s, type = 
%s", action.id, dbName, dbType )) ;
    -        if ( ! dbType.equals(tDatabasetTDB) && ! 
dbType.equals(tDatabasetMem) )
    -            ServletOps.errorBadRequest(format("dbType can be only '%s' or 
'%s'", tDatabasetTDB, tDatabasetMem)) ;
             
    -        String template = null ;
    -        if ( dbType.equalsIgnoreCase(tDatabasetTDB))
    -            template = 
TemplateFunctions.templateFile(Template.templateTDBFN, params, Lang.TTL) ;
    -        if ( dbType.equalsIgnoreCase(tDatabasetMem))
    -            template = 
TemplateFunctions.templateFile(Template.templateMemFN, params, Lang.TTL) ;
    -        RDFParser.create().source(new 
StringReader(template)).base("http://base/";).lang(Lang.TTL).parse(dest);
    +        String template = 
dbTypeToTemplate.get(dbType.toLowerCase(Locale.ROOT));
    +        if ( template == null )
    +                ServletOps.errorBadRequest(format("dbType can be only '%s' 
or '%s'", tDatabaseTDB, tDatabaseMem)) ;
    --- End diff --
    
    This PR now allows three possibilities so the error message is now 
inaccurate


---

Reply via email to