You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@taverna.apache.org by st...@apache.org on 2018/05/11 10:44:30 UTC

[04/14] incubator-taverna-language git commit: add RO conformsTo for COMBINE archives

add RO conformsTo for COMBINE archives


Project: http://git-wip-us.apache.org/repos/asf/incubator-taverna-language/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-taverna-language/commit/dec76891
Tree: http://git-wip-us.apache.org/repos/asf/incubator-taverna-language/tree/dec76891
Diff: http://git-wip-us.apache.org/repos/asf/incubator-taverna-language/diff/dec76891

Branch: refs/heads/master
Commit: dec76891b4bc7613753520adcc931c256563bbe6
Parents: a8c8446
Author: Stian Soiland-Reyes <st...@apache.org>
Authored: Thu May 10 11:13:52 2018 +0100
Committer: Stian Soiland-Reyes <st...@apache.org>
Committed: Thu May 10 17:40:11 2018 +0100

----------------------------------------------------------------------
 .../manifest/combine/CombineManifest.java       | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-taverna-language/blob/dec76891/taverna-robundle/src/main/java/org/apache/taverna/robundle/manifest/combine/CombineManifest.java
----------------------------------------------------------------------
diff --git a/taverna-robundle/src/main/java/org/apache/taverna/robundle/manifest/combine/CombineManifest.java b/taverna-robundle/src/main/java/org/apache/taverna/robundle/manifest/combine/CombineManifest.java
index 0efdd81..898149d 100644
--- a/taverna-robundle/src/main/java/org/apache/taverna/robundle/manifest/combine/CombineManifest.java
+++ b/taverna-robundle/src/main/java/org/apache/taverna/robundle/manifest/combine/CombineManifest.java
@@ -37,6 +37,7 @@ import java.io.InputStream;
 import java.io.OutputStream;
 import java.net.URI;
 import java.net.URISyntaxException;
+import java.nio.file.Files;
 import java.nio.file.Path;
 import java.nio.file.attribute.FileTime;
 import java.util.ArrayList;
@@ -526,6 +527,25 @@ public class CombineManifest {
 				}
 			} else {
 				Path path = bundle.getRoot().resolve(c.getLocation());
+				if (Files.isSameFile(bundle.getRoot(), path)) {
+					// metadata about the archive itself
+					if (c.getFormat() != null && ! c.getFormat().isEmpty()) {
+						URI uri;
+						try {
+							uri = new URI(c.getFormat());
+						} catch (URISyntaxException e) {
+							logger.warning(MANIFEST_XML + " non-URI format for . expected http://identifiers.org/combine.specifications/omex");
+							continue;
+						}
+						if (! manifest.getConformsTo().contains(uri)) {
+							manifest.getConformsTo().add(uri);
+						}
+					}
+					// Don't add / to the list of aggregations in RO,
+					// as / is the RO itself!
+					continue;
+				}
+
 				if (!exists(path)) {
 					logger.warning(MANIFEST_XML + " listed relative path "
 							+ path + ", but it does not exist in bundle");