You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pr@jena.apache.org by GitBox <gi...@apache.org> on 2020/06/07 10:14:37 UTC
[GitHub] [jena] kinow commented on a change in pull request #755: JENA-1913: Multiple --file on the Fuseki command line
kinow commented on a change in pull request #755:
URL: https://github.com/apache/jena/pull/755#discussion_r436347081
##########
File path: jena-fuseki2/jena-fuseki-main/src/main/java/org/apache/jena/fuseki/main/cmds/FusekiMain.java
##########
@@ -282,21 +282,26 @@ protected void processModulesAndArgs() {
}
if ( contains(argFile) ) {
- String filename = getValue(argFile);
- String pathname = filename;
- if ( filename.startsWith("file:") )
- pathname = filename.substring("file:".length());
-
- serverConfig.datasetDescription = "file:"+filename;
- if ( !FileOps.exists(pathname) )
- throw new CmdException("File not found: " + filename);
- serverConfig.dsg = DatasetGraphFactory.createTxnMem();
-
- // INITIAL DATA.
- Lang language = RDFLanguages.filenameToLang(filename);
- if ( language == null )
- throw new CmdException("Can't guess language for file: " + filename);
- Txn.executeWrite(serverConfig.dsg, ()->RDFDataMgr.read(serverConfig.dsg, filename));
+ List<String> filenames = getValues(argFile);
+ String desc = filenames.size() == 1
+ ? "file: "+filenames.get(1)
Review comment:
Isn't the parameter the index of the element? Or is it the number of elements to pop/shift?
##########
File path: jena-fuseki2/jena-fuseki-webapp/src/main/java/org/apache/jena/fuseki/cmd/FusekiCmd.java
##########
@@ -246,21 +247,26 @@ protected void processModulesAndArgs() {
}
if ( contains(argFile) ) {
- String filename = getValue(argFile);
- log.info("Dataset: in-memory: load file: " + filename);
- String pathname = filename;
- if ( filename.startsWith("file:") )
- pathname = filename.substring("file:".length());
- if ( !FileOps.exists(filename) )
- throw new CmdException("File not found: " + filename);
- cmdLineConfig.datasetDescription = "file: "+filename;
+ List<String> filenames = getValues(argFile);
// Directly populate the dataset.
cmdLineConfig.reset();
cmdLineConfig.dsg = DatasetGraphFactory.createTxnMem();
- Lang language = RDFLanguages.filenameToLang(filename);
- if ( language == null )
- throw new CmdException("Can't guess language for file: " + filename);
- Txn.executeWrite(cmdLineConfig.dsg, ()->RDFDataMgr.read(cmdLineConfig.dsg, filename));
+ String desc = filenames.size() == 1
+ ? "file: "+filenames.get(1)
Review comment:
.get(0)? (Spent the day looking at JS and Python, and on mobile, so I might be confusing langs... if so ignore please)
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@jena.apache.org
For additional commands, e-mail: pr-help@jena.apache.org