Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/resource/OseeDatastoreSchemaResource.java')
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/resource/OseeDatastoreSchemaResource.java41
1 files changed, 41 insertions, 0 deletions
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/resource/OseeDatastoreSchemaResource.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/resource/OseeDatastoreSchemaResource.java
new file mode 100644
index 00000000000..ea253966f23
--- /dev/null
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/resource/OseeDatastoreSchemaResource.java
@@ -0,0 +1,41 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Boeing - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.osee.orcs.db.internal.resource;
+
+import java.io.BufferedInputStream;
+import java.io.InputStream;
+import java.net.URL;
+import org.eclipse.osee.database.schema.SchemaResource;
+import org.eclipse.osee.framework.core.exception.OseeCoreException;
+import org.eclipse.osee.framework.core.exception.OseeExceptions;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.FrameworkUtil;
+
+public class OseeDatastoreSchemaResource implements SchemaResource {
+
+ @Override
+ public InputStream getContent() throws OseeCoreException {
+ InputStream inputStream = null;
+ try {
+ Bundle bundle = FrameworkUtil.getBundle(this.getClass());
+ URL url = bundle.getEntry("schema/SKYNET.VERSIONING.SCHEMA.xml");
+ inputStream = new BufferedInputStream(url.openStream());
+ } catch (Exception ex) {
+ OseeExceptions.wrapAndThrow(ex);
+ }
+ return inputStream;
+ }
+
+ @Override
+ public boolean isApplicable() {
+ return true;
+ }
+}

Back to the top