Repository: incubator-taverna-engine Updated Branches: refs/heads/master 9f143dbdf -> c0e52a3f6
File -> Path in taverna-run-api Project: http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/commit/c0e52a3f Tree: http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/tree/c0e52a3f Diff: http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/diff/c0e52a3f Branch: refs/heads/master Commit: c0e52a3f6ed02b58385e9452fc406b7cc33b396c Parents: 9f143db Author: Stian Soiland-Reyes <[email protected]> Authored: Mon Feb 15 09:13:49 2016 +0000 Committer: Stian Soiland-Reyes <[email protected]> Committed: Mon Feb 15 09:13:49 2016 +0000 ---------------------------------------------------------------------- .../taverna/platform/run/api/RunProfile.java | 1 - .../taverna/platform/run/api/RunService.java | 7 +++---- .../platform/run/impl/RunServiceImpl.java | 19 ++++++++----------- 3 files changed, 11 insertions(+), 16 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/c0e52a3f/taverna-run-api/src/main/java/org/apache/taverna/platform/run/api/RunProfile.java ---------------------------------------------------------------------- diff --git a/taverna-run-api/src/main/java/org/apache/taverna/platform/run/api/RunProfile.java b/taverna-run-api/src/main/java/org/apache/taverna/platform/run/api/RunProfile.java index 02d42ab..0cd663b 100644 --- a/taverna-run-api/src/main/java/org/apache/taverna/platform/run/api/RunProfile.java +++ b/taverna-run-api/src/main/java/org/apache/taverna/platform/run/api/RunProfile.java @@ -28,7 +28,6 @@ import org.apache.taverna.scufl2.api.container.WorkflowBundle; * A <code>RunProfile</code> specifies the parameters required to run a * {@link org.apache.taverna.scufl2.api.core.Workflow}. * - * @author David Withers */ public class RunProfile { private ExecutionEnvironment executionEnvironment; http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/c0e52a3f/taverna-run-api/src/main/java/org/apache/taverna/platform/run/api/RunService.java ---------------------------------------------------------------------- diff --git a/taverna-run-api/src/main/java/org/apache/taverna/platform/run/api/RunService.java b/taverna-run-api/src/main/java/org/apache/taverna/platform/run/api/RunService.java index 48a0aa2..7c5211a 100644 --- a/taverna-run-api/src/main/java/org/apache/taverna/platform/run/api/RunService.java +++ b/taverna-run-api/src/main/java/org/apache/taverna/platform/run/api/RunService.java @@ -19,8 +19,8 @@ package org.apache.taverna.platform.run.api; -import java.io.File; import java.io.IOException; +import java.nio.file.Path; import java.util.List; import java.util.Set; @@ -38,7 +38,6 @@ import org.apache.taverna.scufl2.api.profiles.Profile; /** * Service for managing runs of Taverna workflows. * - * @author David Withers */ public interface RunService { String EVENT_TOPIC_ROOT = "org/apache/taverna/platform/run/RunService/"; @@ -116,7 +115,7 @@ public interface RunService { * @throws InvalidWorkflowException * @throws RunProfileException */ - String open(File runFile) throws IOException; + String open(Path runFile) throws IOException; /** * Closes a run. @@ -139,7 +138,7 @@ public interface RunService { * if the run ID is not valid * @throws InvalidExecutionIdException */ - void save(String runID, File runFile) throws InvalidRunIdException, + void save(String runID, Path runFile) throws InvalidRunIdException, IOException; /** http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/c0e52a3f/taverna-run-impl/src/main/java/org/apache/taverna/platform/run/impl/RunServiceImpl.java ---------------------------------------------------------------------- diff --git a/taverna-run-impl/src/main/java/org/apache/taverna/platform/run/impl/RunServiceImpl.java b/taverna-run-impl/src/main/java/org/apache/taverna/platform/run/impl/RunServiceImpl.java index f7afba3..e66cea9 100755 --- a/taverna-run-impl/src/main/java/org/apache/taverna/platform/run/impl/RunServiceImpl.java +++ b/taverna-run-impl/src/main/java/org/apache/taverna/platform/run/impl/RunServiceImpl.java @@ -19,7 +19,6 @@ package org.apache.taverna.platform.run.impl; -import java.io.File; import java.io.IOException; import java.nio.file.ClosedFileSystemException; import java.nio.file.InvalidPathException; @@ -35,10 +34,6 @@ import java.util.TreeMap; import java.util.logging.Level; import java.util.logging.Logger; -import org.osgi.service.event.Event; -import org.osgi.service.event.EventAdmin; -import org.apache.taverna.robundle.Bundle; - import org.apache.taverna.databundle.DataBundles; import org.apache.taverna.platform.execution.api.ExecutionEnvironment; import org.apache.taverna.platform.execution.api.ExecutionEnvironmentService; @@ -52,16 +47,18 @@ import org.apache.taverna.platform.run.api.RunProfile; import org.apache.taverna.platform.run.api.RunProfileException; import org.apache.taverna.platform.run.api.RunService; import org.apache.taverna.platform.run.api.RunStateException; +import org.apache.taverna.robundle.Bundle; import org.apache.taverna.scufl2.api.container.WorkflowBundle; import org.apache.taverna.scufl2.api.core.Workflow; import org.apache.taverna.scufl2.api.io.ReaderException; import org.apache.taverna.scufl2.api.io.WorkflowBundleIO; import org.apache.taverna.scufl2.api.profiles.Profile; +import org.osgi.service.event.Event; +import org.osgi.service.event.EventAdmin; /** * Implementation of the <code>RunService</code>. * - * @author David Withers */ public class RunServiceImpl implements RunService { private static final Logger logger = Logger.getLogger(RunServiceImpl.class.getName()); @@ -105,14 +102,14 @@ public class RunServiceImpl implements RunService { } @Override - public String open(File runFile) throws IOException { + public String open(Path runFile) throws IOException { try { - String runID = runFile.getName(); + String runID = runFile.getFileName().toString(); int dot = runID.indexOf('.'); if (dot > 0) runID = runID.substring(0, dot); if (!runMap.containsKey(runID)) { - Bundle bundle = DataBundles.openBundle(runFile.toPath()); + Bundle bundle = DataBundles.openBundle(runFile); Run run = new Run(runID, bundle); runMap.put(run.getID(), run); } @@ -137,11 +134,11 @@ public class RunServiceImpl implements RunService { } @Override - public void save(String runID, File runFile) throws InvalidRunIdException, IOException { + public void save(String runID, Path runFile) throws InvalidRunIdException, IOException { Run run = getRun(runID); Bundle dataBundle = run.getDataBundle(); try { - DataBundles.closeAndSaveBundle(dataBundle, runFile.toPath()); + DataBundles.closeAndSaveBundle(dataBundle, runFile); } catch (InvalidPathException e) { throw new IOException(e); }
