Skip to content

Commit

Permalink
Fix relative path for config file
Browse files Browse the repository at this point in the history
  • Loading branch information
melaasar committed Jan 25, 2023
1 parent 26a7f02 commit 85ad6f2
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 13 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
subprojects {
group = 'io.opencaesar.owl'
version = '1.1.2'
version = '1.1.3'

ext.versions = [
owl: '5.1.17',
Expand Down
39 changes: 27 additions & 12 deletions owl-fuseki/src/main/java/io/opencaesar/owl/fuseki/FusekiApp.java
Original file line number Diff line number Diff line change
@@ -1,9 +1,23 @@
package io.opencaesar.owl.fuseki;

import java.io.*;
import java.net.*;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.net.HttpURLConnection;
import java.net.URISyntaxException;
import java.net.URL;
import java.nio.file.Path;
import java.util.*;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Optional;
import java.util.zip.ZipEntry;
import java.util.zip.ZipInputStream;

Expand All @@ -13,19 +27,15 @@
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import org.apache.log4j.xml.DOMConfigurator;

import com.beust.jcommander.IStringConverter;
import com.beust.jcommander.JCommander;
import com.beust.jcommander.Parameter;
import com.beust.jcommander.ParameterException;

import org.apache.maven.repository.internal.MavenRepositorySystemUtils;
import org.apache.maven.resolver.owl.fuseki.ManualRepositorySystemFactory;
import org.eclipse.aether.DefaultRepositorySystemSession;
import org.eclipse.aether.RepositorySystem;
import org.eclipse.aether.artifact.Artifact;
import org.eclipse.aether.artifact.DefaultArtifact;
import org.eclipse.aether.collection.*;
import org.eclipse.aether.collection.CollectRequest;
import org.eclipse.aether.collection.CollectResult;
import org.eclipse.aether.collection.DependencyCollectionException;
import org.eclipse.aether.graph.Dependency;
import org.eclipse.aether.graph.DependencyNode;
import org.eclipse.aether.graph.DependencyVisitor;
Expand All @@ -35,6 +45,11 @@
import org.eclipse.aether.resolution.ArtifactResolutionException;
import org.eclipse.aether.resolution.ArtifactResult;

import com.beust.jcommander.IStringConverter;
import com.beust.jcommander.JCommander;
import com.beust.jcommander.Parameter;
import com.beust.jcommander.ParameterException;

/**
* Start an Apache Fuseki server, either in headless mode or with a web UI.
* This application resolves the Apache Fuseki dependencies from a remote maven repository
Expand Down Expand Up @@ -305,11 +320,11 @@ public static void startFuseki(
if (pingArg) {
args[pos++] = "--ping";
}
args[pos++] = "--config=" + config.getName(); // put the simple file name to avoid spaces in path
args[pos++] = "--config=" + output.relativize(config.toPath()); // put the relative path to avoid spaces in path

System.arraycopy(argv, 0, args, pos, argv.length);
ProcessBuilder pb = new ProcessBuilder(args);
pb.directory(config.getParentFile()); // run in the config file's folder
pb.directory(output.toFile());
pb.redirectErrorStream(true);
pb.redirectOutput(logFile);

Expand Down

0 comments on commit 85ad6f2

Please sign in to comment.