Skip to content

Commit

Permalink
FusekiServerCtl
Browse files Browse the repository at this point in the history
  • Loading branch information
afs committed Dec 20, 2024
1 parent 4904045 commit 1d02853
Show file tree
Hide file tree
Showing 16 changed files with 275 additions and 156 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

package org.apache.jena.fuseki.main.cmds;

import org.apache.jena.fuseki.run.FusekiModServer;
import org.apache.jena.fuseki.mod.FusekiModServer;
import org.apache.jena.fuseki.system.FusekiLogging;

/** Fuseki command that runs a Fuseki server with the admin UI.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,11 @@ public void execute(HttpAction action) {
};

private JsonValue description(HttpAction action) {
if ( ! Files.isDirectory(FusekiApp.dirBackups) )
ServletOps.errorOccurred(format("[%d] Backup area '%s' is not a directory", action.id, FusekiApp.dirBackups));
if ( ! Files.isDirectory(FusekiServerCtl.dirBackups) )
ServletOps.errorOccurred(format("[%d] Backup area '%s' is not a directory", action.id, FusekiServerCtl.dirBackups));

List<Path> paths = new ArrayList<>();
try (DirectoryStream<Path> stream = Files.newDirectoryStream(FusekiApp.dirBackups, filterVisibleFiles)) {
try (DirectoryStream<Path> stream = Files.newDirectoryStream(FusekiServerCtl.dirBackups, filterVisibleFiles)) {
stream.forEach(paths::add);
} catch (IOException ex) {
action.log.error(format("[%d] Backup file list :: IOException :: %s", action.id, ex.getMessage()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ else if ( WebContent.isMultiPartForm(ct) )
// ----
// Keep a persistent copy immediately. This is not used for
// anything other than being "for the record".
systemFileCopy = FusekiApp.dirSystemFileArea.resolve(uuid.toString()).toString();
systemFileCopy = FusekiServerCtl.dirSystemFileArea.resolve(uuid.toString()).toString();
try ( OutputStream outCopy = IO.openOutputFile(systemFileCopy) ) {
RDFDataMgr.write(outCopy, descriptionModel, Lang.TURTLE);
}
Expand Down Expand Up @@ -186,8 +186,8 @@ else if ( WebContent.isMultiPartForm(ct) )

action.log.info(format("[%d] Create database : name = %s", action.id, datasetPath));

configFile = FusekiApp.generateConfigurationFilename(datasetPath);
List<String> existing = FusekiApp.existingConfigurationFile(datasetPath);
configFile = FusekiServerCtl.generateConfigurationFilename(datasetPath);
List<String> existing = FusekiServerCtl.existingConfigurationFile(datasetPath);
if ( ! existing.isEmpty() )
ServletOps.error(HttpSC.CONFLICT_409, "Configuration file for '"+datasetPath+"' already exists");

Expand Down Expand Up @@ -318,7 +318,7 @@ protected void execDeleteItem(HttpAction action) {

// Find the configuration.
String filename = name.startsWith("/") ? name.substring(1) : name;
List<String> configurationFiles = FusekiApp.existingConfigurationFile(filename);
List<String> configurationFiles = FusekiServerCtl.existingConfigurationFile(filename);

if ( configurationFiles.isEmpty() ) {
// ---- Unmanaged
Expand Down Expand Up @@ -363,7 +363,7 @@ protected void execDeleteItem(HttpAction action) {
// Delete databases created by the UI, or the admin operation, which are
// in predictable, unshared location on disk.
// There may not be any database files, the in-memory case.
Path pDatabase = FusekiApp.dirDatabases.resolve(filename);
Path pDatabase = FusekiServerCtl.dirDatabases.resolve(filename);
if ( Files.exists(pDatabase)) {
try {
if ( Files.isSymbolicLink(pDatabase)) {
Expand Down Expand Up @@ -411,7 +411,7 @@ private static void assemblerFromForm(HttpAction action, StreamRDF dest) {
params.put(Template.NAME, dbName.substring(1));
else
params.put(Template.NAME, dbName);
FusekiApp.addGlobals(params);
FusekiServerCtl.addGlobals(params);

//action.log.info(format("[%d] Create database : name = %s, type = %s", action.id, dbName, dbType ));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public static String chooseFileName(String dsName) {

String timestamp = DateTimeUtils.nowAsString("yyyy-MM-dd_HH-mm-ss");
String filename = ds + "_" + timestamp;
filename = FusekiApp.dirBackups.resolve(filename).toString();
filename = FusekiServerCtl.dirBackups.resolve(filename).toString();
return filename;
}

Expand Down
Loading

0 comments on commit 1d02853

Please sign in to comment.