Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrbrooks2010-07-24 08:02:08 +0000
committerrbrooks2010-07-24 08:02:08 +0000
commit4ed8bddc791fda93940f238c5135556a07041dc0 (patch)
tree64a118285c5006c3a38320dbb2d374e8ea72a061 /plugins/org.eclipse.osee.framework.resource.management
parent542cc7344d3f129d64e47f547384297c8e1b1f43 (diff)
downloadorg.eclipse.osee-4ed8bddc791fda93940f238c5135556a07041dc0.tar.gz
org.eclipse.osee-4ed8bddc791fda93940f238c5135556a07041dc0.tar.xz
org.eclipse.osee-4ed8bddc791fda93940f238c5135556a07041dc0.zip
converted all line terminators to unix style
Diffstat (limited to 'plugins/org.eclipse.osee.framework.resource.management')
-rw-r--r--plugins/org.eclipse.osee.framework.resource.management/.classpath14
-rw-r--r--plugins/org.eclipse.osee.framework.resource.management/.project56
-rw-r--r--plugins/org.eclipse.osee.framework.resource.management/build.properties10
-rw-r--r--plugins/org.eclipse.osee.framework.resource.management/src/org/eclipse/osee/framework/resource/management/IResource.java102
-rw-r--r--plugins/org.eclipse.osee.framework.resource.management/src/org/eclipse/osee/framework/resource/management/IResourceListener.java128
-rw-r--r--plugins/org.eclipse.osee.framework.resource.management/src/org/eclipse/osee/framework/resource/management/IResourceLocator.java80
-rw-r--r--plugins/org.eclipse.osee.framework.resource.management/src/org/eclipse/osee/framework/resource/management/IResourceLocatorManager.java128
-rw-r--r--plugins/org.eclipse.osee.framework.resource.management/src/org/eclipse/osee/framework/resource/management/IResourceLocatorProvider.java104
-rw-r--r--plugins/org.eclipse.osee.framework.resource.management/src/org/eclipse/osee/framework/resource/management/IResourceManager.java170
-rw-r--r--plugins/org.eclipse.osee.framework.resource.management/src/org/eclipse/osee/framework/resource/management/IResourceProvider.java138
-rw-r--r--plugins/org.eclipse.osee.framework.resource.management/src/org/eclipse/osee/framework/resource/management/Options.java60
-rw-r--r--plugins/org.eclipse.osee.framework.resource.management/src/org/eclipse/osee/framework/resource/management/StandardOptions.java36
-rw-r--r--plugins/org.eclipse.osee.framework.resource.management/src/org/eclipse/osee/framework/resource/management/exception/EmptyResourceException.java66
-rw-r--r--plugins/org.eclipse.osee.framework.resource.management/src/org/eclipse/osee/framework/resource/management/exception/InvalidLocatorException.java68
-rw-r--r--plugins/org.eclipse.osee.framework.resource.management/src/org/eclipse/osee/framework/resource/management/exception/MalformedLocatorException.java88
-rw-r--r--plugins/org.eclipse.osee.framework.resource.management/src/org/eclipse/osee/framework/resource/management/internal/CompressedResourceBridge.java108
-rw-r--r--plugins/org.eclipse.osee.framework.resource.management/src/org/eclipse/osee/framework/resource/management/internal/ResourceLocatorManager.java166
-rw-r--r--plugins/org.eclipse.osee.framework.resource.management/src/org/eclipse/osee/framework/resource/management/internal/ResourceManager.java272
-rw-r--r--plugins/org.eclipse.osee.framework.resource.management/src/org/eclipse/osee/framework/resource/management/util/OptionsProcessor.java244
-rw-r--r--plugins/org.eclipse.osee.framework.resource.management/src/org/eclipse/osee/framework/resource/management/util/Resource.java112
-rw-r--r--plugins/org.eclipse.osee.framework.resource.management/src/org/eclipse/osee/framework/resource/management/util/ResourceLocator.java106
-rw-r--r--plugins/org.eclipse.osee.framework.resource.management/src/org/eclipse/osee/framework/resource/management/util/Resources.java162
22 files changed, 1209 insertions, 1209 deletions
diff --git a/plugins/org.eclipse.osee.framework.resource.management/.classpath b/plugins/org.eclipse.osee.framework.resource.management/.classpath
index 8a8f1668cd..ad32c83a78 100644
--- a/plugins/org.eclipse.osee.framework.resource.management/.classpath
+++ b/plugins/org.eclipse.osee.framework.resource.management/.classpath
@@ -1,7 +1,7 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/plugins/org.eclipse.osee.framework.resource.management/.project b/plugins/org.eclipse.osee.framework.resource.management/.project
index 4fd2e4b8d4..50b5a56e69 100644
--- a/plugins/org.eclipse.osee.framework.resource.management/.project
+++ b/plugins/org.eclipse.osee.framework.resource.management/.project
@@ -1,28 +1,28 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.osee.framework.resource.management</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.osee.framework.resource.management</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
diff --git a/plugins/org.eclipse.osee.framework.resource.management/build.properties b/plugins/org.eclipse.osee.framework.resource.management/build.properties
index a65755cb2a..c58ea2178c 100644
--- a/plugins/org.eclipse.osee.framework.resource.management/build.properties
+++ b/plugins/org.eclipse.osee.framework.resource.management/build.properties
@@ -1,5 +1,5 @@
-source.. = src/
-output.. = bin/
-bin.includes = META-INF/,\
- .,\
- OSGI-INF/
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ OSGI-INF/
diff --git a/plugins/org.eclipse.osee.framework.resource.management/src/org/eclipse/osee/framework/resource/management/IResource.java b/plugins/org.eclipse.osee.framework.resource.management/src/org/eclipse/osee/framework/resource/management/IResource.java
index 2b625a6583..ec343a1687 100644
--- a/plugins/org.eclipse.osee.framework.resource.management/src/org/eclipse/osee/framework/resource/management/IResource.java
+++ b/plugins/org.eclipse.osee.framework.resource.management/src/org/eclipse/osee/framework/resource/management/IResource.java
@@ -1,51 +1,51 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2007 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.framework.resource.management;
-
-import java.io.InputStream;
-import java.net.URI;
-import org.eclipse.osee.framework.core.exception.OseeCoreException;
-
-/**
- * @author Roberto E. Escobar
- */
-public interface IResource {
-
- /**
- * Returns an open input stream of the contents of this resource.
- *
- * @return an input stream containing the contents of this resource
- * @throws OseeCoreException if this method fails.
- */
- public InputStream getContent() throws OseeCoreException;
-
- /**
- * Returns the absolute URI of this resource, or <code>null</code> if no URI can be determined.
- *
- * @return the absolute URI of this resource, or <code>null</code> if no URI can be determined
- */
- public URI getLocation();
-
- /**
- * Get the name of this resource
- *
- * @return name of this resource
- */
- public String getName();
-
- /**
- * Whether this resource is compressed or not.
- *
- * @return <b>true</b> If this resource is compressed. <b>false</b> If this resource is not compressed.
- */
- public boolean isCompressed();
-
-}
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.framework.resource.management;
+
+import java.io.InputStream;
+import java.net.URI;
+import org.eclipse.osee.framework.core.exception.OseeCoreException;
+
+/**
+ * @author Roberto E. Escobar
+ */
+public interface IResource {
+
+ /**
+ * Returns an open input stream of the contents of this resource.
+ *
+ * @return an input stream containing the contents of this resource
+ * @throws OseeCoreException if this method fails.
+ */
+ public InputStream getContent() throws OseeCoreException;
+
+ /**
+ * Returns the absolute URI of this resource, or <code>null</code> if no URI can be determined.
+ *
+ * @return the absolute URI of this resource, or <code>null</code> if no URI can be determined
+ */
+ public URI getLocation();
+
+ /**
+ * Get the name of this resource
+ *
+ * @return name of this resource
+ */
+ public String getName();
+
+ /**
+ * Whether this resource is compressed or not.
+ *
+ * @return <b>true</b> If this resource is compressed. <b>false</b> If this resource is not compressed.
+ */
+ public boolean isCompressed();
+
+}
diff --git a/plugins/org.eclipse.osee.framework.resource.management/src/org/eclipse/osee/framework/resource/management/IResourceListener.java b/plugins/org.eclipse.osee.framework.resource.management/src/org/eclipse/osee/framework/resource/management/IResourceListener.java
index f2fa0c9420..d75024b562 100644
--- a/plugins/org.eclipse.osee.framework.resource.management/src/org/eclipse/osee/framework/resource/management/IResourceListener.java
+++ b/plugins/org.eclipse.osee.framework.resource.management/src/org/eclipse/osee/framework/resource/management/IResourceListener.java
@@ -1,64 +1,64 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2007 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.framework.resource.management;
-
-/**
- * @author Roberto E. Escobar
- */
-public interface IResourceListener {
-
- /**
- * Event triggered before a resource is deleted
- *
- * @param locator
- */
- public void onPreDelete(IResourceLocator locator);
-
- /**
- * Event triggered after a resource is deleted
- *
- * @param locator
- */
- public void onPostDelete(IResourceLocator locator);
-
- /**
- * Event triggered before a resource is saved
- *
- * @param locator
- * @param options
- * @param resource
- */
- public void onPreSave(IResourceLocator locator, IResource resource, Options options);
-
- /**
- * Event triggered after a resource is saved
- *
- * @param locator
- * @param resource
- * @param options
- */
- public void onPostSave(IResourceLocator locator, IResource resource, Options options);
-
- /**
- * Event triggered before a resource is acquired
- *
- * @param locator
- */
- public void onPreAcquire(IResourceLocator locator);
-
- /**
- * Event triggered after a resource is acquired
- *
- * @param resource
- */
- public void onPostAcquire(IResource resource);
-
-}
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.framework.resource.management;
+
+/**
+ * @author Roberto E. Escobar
+ */
+public interface IResourceListener {
+
+ /**
+ * Event triggered before a resource is deleted
+ *
+ * @param locator
+ */
+ public void onPreDelete(IResourceLocator locator);
+
+ /**
+ * Event triggered after a resource is deleted
+ *
+ * @param locator
+ */
+ public void onPostDelete(IResourceLocator locator);
+
+ /**
+ * Event triggered before a resource is saved
+ *
+ * @param locator
+ * @param options
+ * @param resource
+ */
+ public void onPreSave(IResourceLocator locator, IResource resource, Options options);
+
+ /**
+ * Event triggered after a resource is saved
+ *
+ * @param locator
+ * @param resource
+ * @param options
+ */
+ public void onPostSave(IResourceLocator locator, IResource resource, Options options);
+
+ /**
+ * Event triggered before a resource is acquired
+ *
+ * @param locator
+ */
+ public void onPreAcquire(IResourceLocator locator);
+
+ /**
+ * Event triggered after a resource is acquired
+ *
+ * @param resource
+ */
+ public void onPostAcquire(IResource resource);
+
+}
diff --git a/plugins/org.eclipse.osee.framework.resource.management/src/org/eclipse/osee/framework/resource/management/IResourceLocator.java b/plugins/org.eclipse.osee.framework.resource.management/src/org/eclipse/osee/framework/resource/management/IResourceLocator.java
index 6a7693ff90..f8525e56df 100644
--- a/plugins/org.eclipse.osee.framework.resource.management/src/org/eclipse/osee/framework/resource/management/IResourceLocator.java
+++ b/plugins/org.eclipse.osee.framework.resource.management/src/org/eclipse/osee/framework/resource/management/IResourceLocator.java
@@ -1,40 +1,40 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2007 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.framework.resource.management;
-
-import java.net.URI;
-
-/**
- * @author Roberto E. Escobar
- */
-public interface IResourceLocator {
-
- /**
- * Location describing a resource
- *
- * @return uri to resource
- */
- public URI getLocation();
-
- /**
- * Get this locators protocol
- *
- * @return String
- */
- public String getProtocol();
-
- /**
- * Get the raw path.
- *
- * @return raw path
- */
- public String getRawPath();
-}
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.framework.resource.management;
+
+import java.net.URI;
+
+/**
+ * @author Roberto E. Escobar
+ */
+public interface IResourceLocator {
+
+ /**
+ * Location describing a resource
+ *
+ * @return uri to resource
+ */
+ public URI getLocation();
+
+ /**
+ * Get this locators protocol
+ *
+ * @return String
+ */
+ public String getProtocol();
+
+ /**
+ * Get the raw path.
+ *
+ * @return raw path
+ */
+ public String getRawPath();
+}
diff --git a/plugins/org.eclipse.osee.framework.resource.management/src/org/eclipse/osee/framework/resource/management/IResourceLocatorManager.java b/plugins/org.eclipse.osee.framework.resource.management/src/org/eclipse/osee/framework/resource/management/IResourceLocatorManager.java
index dd07226e23..c501f14ccc 100644
--- a/plugins/org.eclipse.osee.framework.resource.management/src/org/eclipse/osee/framework/resource/management/IResourceLocatorManager.java
+++ b/plugins/org.eclipse.osee.framework.resource.management/src/org/eclipse/osee/framework/resource/management/IResourceLocatorManager.java
@@ -1,64 +1,64 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2007 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.framework.resource.management;
-
-import java.util.Collection;
-import org.eclipse.osee.framework.core.exception.OseeCoreException;
-import org.eclipse.osee.framework.resource.management.exception.MalformedLocatorException;
-
-/**
- * @author Roberto E. Escobar
- */
-public interface IResourceLocatorManager {
-
- /**
- * Generate a resource locator based on protocol, seed and name
- *
- * @param protocol
- * @param seed
- * @param name
- * @return a resource locator
- * @throws MalformedLocatorException
- */
- IResourceLocator generateResourceLocator(String protocol, String seed, String name) throws OseeCoreException;
-
- /**
- * Get resource locator based on protocol and path
- *
- * @param path
- * @return a resource locator
- * @throws MalformedLocatorException
- */
- IResourceLocator getResourceLocator(String path) throws OseeCoreException;
-
- /**
- * Add resource locator provider
- *
- * @param resourceLocatorProvider
- * @return <b>true<b> if the locator was added
- */
- boolean addResourceLocatorProvider(IResourceLocatorProvider resourceLocatorProvider);
-
- /**
- * Remove resource locator provider
- *
- * @param resourceLocatorProvider
- * @return <b>true<b> if the locator was removed
- */
- boolean removeResourceLocatorProvider(IResourceLocatorProvider resourceLocatorProvider);
-
- /**
- * Supported Protocols
- *
- * @return supported protocols
- */
- Collection<String> getProtocols();
-}
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.framework.resource.management;
+
+import java.util.Collection;
+import org.eclipse.osee.framework.core.exception.OseeCoreException;
+import org.eclipse.osee.framework.resource.management.exception.MalformedLocatorException;
+
+/**
+ * @author Roberto E. Escobar
+ */
+public interface IResourceLocatorManager {
+
+ /**
+ * Generate a resource locator based on protocol, seed and name
+ *
+ * @param protocol
+ * @param seed
+ * @param name
+ * @return a resource locator
+ * @throws MalformedLocatorException
+ */
+ IResourceLocator generateResourceLocator(String protocol, String seed, String name) throws OseeCoreException;
+
+ /**
+ * Get resource locator based on protocol and path
+ *
+ * @param path
+ * @return a resource locator
+ * @throws MalformedLocatorException
+ */
+ IResourceLocator getResourceLocator(String path) throws OseeCoreException;
+
+ /**
+ * Add resource locator provider
+ *
+ * @param resourceLocatorProvider
+ * @return <b>true<b> if the locator was added
+ */
+ boolean addResourceLocatorProvider(IResourceLocatorProvider resourceLocatorProvider);
+
+ /**
+ * Remove resource locator provider
+ *
+ * @param resourceLocatorProvider
+ * @return <b>true<b> if the locator was removed
+ */
+ boolean removeResourceLocatorProvider(IResourceLocatorProvider resourceLocatorProvider);
+
+ /**
+ * Supported Protocols
+ *
+ * @return supported protocols
+ */
+ Collection<String> getProtocols();
+}
diff --git a/plugins/org.eclipse.osee.framework.resource.management/src/org/eclipse/osee/framework/resource/management/IResourceLocatorProvider.java b/plugins/org.eclipse.osee.framework.resource.management/src/org/eclipse/osee/framework/resource/management/IResourceLocatorProvider.java
index 3bdddfd11b..5a8c8818c7 100644
--- a/plugins/org.eclipse.osee.framework.resource.management/src/org/eclipse/osee/framework/resource/management/IResourceLocatorProvider.java
+++ b/plugins/org.eclipse.osee.framework.resource.management/src/org/eclipse/osee/framework/resource/management/IResourceLocatorProvider.java
@@ -1,52 +1,52 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2007 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.framework.resource.management;
-
-import org.eclipse.osee.framework.core.exception.OseeCoreException;
-import org.eclipse.osee.framework.resource.management.exception.MalformedLocatorException;
-
-/**
- * @author Roberto E. Escobar
- */
-public interface IResourceLocatorProvider {
-
- /**
- * Supported Protocol
- */
- public String getSupportedProtocol();
-
- /**
- * Check if this provider is valid
- *
- * @param protocol
- * @return <b>true</b> if this provider is valid
- */
- public boolean isValid(String protocol);
-
- /**
- * Generate a resource locator based on seed and name
- *
- * @param seed
- * @param name
- * @return a resource locator
- * @throws MalformedLocatorException
- */
- IResourceLocator generateResourceLocator(String seed, String name) throws OseeCoreException;
-
- /**
- * Get resource locator
- *
- * @param path
- * @return a resource locator
- * @throws MalformedLocatorException
- */
- IResourceLocator getResourceLocator(String path) throws OseeCoreException;
-}
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.framework.resource.management;
+
+import org.eclipse.osee.framework.core.exception.OseeCoreException;
+import org.eclipse.osee.framework.resource.management.exception.MalformedLocatorException;
+
+/**
+ * @author Roberto E. Escobar
+ */
+public interface IResourceLocatorProvider {
+
+ /**
+ * Supported Protocol
+ */
+ public String getSupportedProtocol();
+
+ /**
+ * Check if this provider is valid
+ *
+ * @param protocol
+ * @return <b>true</b> if this provider is valid
+ */
+ public boolean isValid(String protocol);
+
+ /**
+ * Generate a resource locator based on seed and name
+ *
+ * @param seed
+ * @param name
+ * @return a resource locator
+ * @throws MalformedLocatorException
+ */
+ IResourceLocator generateResourceLocator(String seed, String name) throws OseeCoreException;
+
+ /**
+ * Get resource locator
+ *
+ * @param path
+ * @return a resource locator
+ * @throws MalformedLocatorException
+ */
+ IResourceLocator getResourceLocator(String path) throws OseeCoreException;
+}
diff --git a/plugins/org.eclipse.osee.framework.resource.management/src/org/eclipse/osee/framework/resource/management/IResourceManager.java b/plugins/org.eclipse.osee.framework.resource.management/src/org/eclipse/osee/framework/resource/management/IResourceManager.java
index b9d3b2096c..e0c0834c03 100644
--- a/plugins/org.eclipse.osee.framework.resource.management/src/org/eclipse/osee/framework/resource/management/IResourceManager.java
+++ b/plugins/org.eclipse.osee.framework.resource.management/src/org/eclipse/osee/framework/resource/management/IResourceManager.java
@@ -1,85 +1,85 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2007 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.framework.resource.management;
-
-import org.eclipse.osee.framework.core.exception.OseeCoreException;
-
-/**
- * @author Roberto E. Escobar
- */
-public interface IResourceManager {
-
- public static final int OK = 1;
- public static final int FAIL = 2;
- public static final int RESOURCE_NOT_FOUND = 3;
-
- /**
- * Add listener to list
- *
- * @param listener
- */
- public boolean addResourceListener(IResourceListener listener);
-
- /**
- * Remove listener from list
- *
- * @param listener
- */
- public boolean removeResourceListener(IResourceListener listener);
-
- /**
- * Add a resource provider
- *
- * @param resourceProvider to add
- */
- public boolean addResourceProvider(IResourceProvider resourceProvider);
-
- /**
- * Remove a resource provider
- *
- * @param resourceProvider to remove
- */
- public boolean removeResourceProvider(IResourceProvider resourceProvider);
-
- /**
- * Acquire resource specified by resource locator
- *
- * @param locator location of the resource needed
- * @param options operation options
- * @return the resource
- */
- public IResource acquire(IResourceLocator locator, Options options) throws OseeCoreException;
-
- /**
- * Determines if a resource exists for the given locator.
- *
- * @param locator location of the data to check
- */
- public boolean exists(IResourceLocator locator) throws OseeCoreException;
-
- /**
- * Save input to location specified by resource locator
- *
- * @param locator location where to store the data
- * @param resource to store
- * @param options operation options
- * @return status
- */
- public IResourceLocator save(final IResourceLocator locatorHint, final IResource resource, final Options options) throws OseeCoreException;
-
- /**
- * Delete resource specified by resource locator
- *
- * @param locator location of the resource to delete
- * @return status
- */
- public int delete(IResourceLocator locator) throws OseeCoreException;
-}
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.framework.resource.management;
+
+import org.eclipse.osee.framework.core.exception.OseeCoreException;
+
+/**
+ * @author Roberto E. Escobar
+ */
+public interface IResourceManager {
+
+ public static final int OK = 1;
+ public static final int FAIL = 2;
+ public static final int RESOURCE_NOT_FOUND = 3;
+
+ /**
+ * Add listener to list
+ *
+ * @param listener
+ */
+ public boolean addResourceListener(IResourceListener listener);
+
+ /**
+ * Remove listener from list
+ *
+ * @param listener
+ */
+ public boolean removeResourceListener(IResourceListener listener);
+
+ /**
+ * Add a resource provider
+ *
+ * @param resourceProvider to add
+ */
+ public boolean addResourceProvider(IResourceProvider resourceProvider);
+
+ /**
+ * Remove a resource provider
+ *
+ * @param resourceProvider to remove
+ */
+ public boolean removeResourceProvider(IResourceProvider resourceProvider);
+
+ /**
+ * Acquire resource specified by resource locator
+ *
+ * @param locator location of the resource needed
+ * @param options operation options
+ * @return the resource
+ */
+ public IResource acquire(IResourceLocator locator, Options options) throws OseeCoreException;
+
+ /**
+ * Determines if a resource exists for the given locator.
+ *
+ * @param locator location of the data to check
+ */
+ public boolean exists(IResourceLocator locator) throws OseeCoreException;
+
+ /**
+ * Save input to location specified by resource locator
+ *
+ * @param locator location where to store the data
+ * @param resource to store
+ * @param options operation options
+ * @return status
+ */
+ public IResourceLocator save(final IResourceLocator locatorHint, final IResource resource, final Options options) throws OseeCoreException;
+
+ /**
+ * Delete resource specified by resource locator
+ *
+ * @param locator location of the resource to delete
+ * @return status
+ */
+ public int delete(IResourceLocator locator) throws OseeCoreException;
+}
diff --git a/plugins/org.eclipse.osee.framework.resource.management/src/org/eclipse/osee/framework/resource/management/IResourceProvider.java b/plugins/org.eclipse.osee.framework.resource.management/src/org/eclipse/osee/framework/resource/management/IResourceProvider.java
index d38ef74842..85b4dbac72 100644
--- a/plugins/org.eclipse.osee.framework.resource.management/src/org/eclipse/osee/framework/resource/management/IResourceProvider.java
+++ b/plugins/org.eclipse.osee.framework.resource.management/src/org/eclipse/osee/framework/resource/management/IResourceProvider.java
@@ -1,69 +1,69 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2007 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.framework.resource.management;
-
-import java.util.Collection;
-import org.eclipse.osee.framework.core.exception.OseeCoreException;
-
-/**
- * @author Roberto E. Escobar
- */
-public interface IResourceProvider {
-
- /**
- * Determines whether this provider is valid for this locator
- *
- * @param locator location of the resource needed
- * @return boolean
- */
- public boolean isValid(IResourceLocator locator);
-
- /**
- * Acquire resource specified by resource locator
- *
- * @param locator location of the resource needed
- * @param options operation options
- * @return the resource
- */
- public IResource acquire(IResourceLocator locator, Options options) throws OseeCoreException;
-
- /**
- * Determines if a resource exists for the given locator.
- *
- * @param locator location of the data to check
- */
- public boolean exists(IResourceLocator locator) throws OseeCoreException;
-
- /**
- * Save input to location specified by resource locator
- *
- * @param locator location where to store the data
- * @param options operation options
- * @param resource the resource to save
- * @return status
- */
- public IResourceLocator save(IResourceLocator locator, IResource resource, Options options) throws OseeCoreException;
-
- /**
- * Delete resource specified by resource locator
- *
- * @param locator location of the resource to delete
- * @return status
- */
- public int delete(IResourceLocator locator) throws OseeCoreException;
-
- /**
- * Get provider supported protocols
- *
- * @return supported protocols
- */
- public Collection<String> getSupportedProtocols();
-}
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.framework.resource.management;
+
+import java.util.Collection;
+import org.eclipse.osee.framework.core.exception.OseeCoreException;
+
+/**
+ * @author Roberto E. Escobar
+ */
+public interface IResourceProvider {
+
+ /**
+ * Determines whether this provider is valid for this locator
+ *
+ * @param locator location of the resource needed
+ * @return boolean
+ */
+ public boolean isValid(IResourceLocator locator);
+
+ /**
+ * Acquire resource specified by resource locator
+ *
+ * @param locator location of the resource needed
+ * @param options operation options
+ * @return the resource
+ */
+ public IResource acquire(IResourceLocator locator, Options options) throws OseeCoreException;
+
+ /**
+ * Determines if a resource exists for the given locator.
+ *
+ * @param locator location of the data to check
+ */
+ public boolean exists(IResourceLocator locator) throws OseeCoreException;
+
+ /**
+ * Save input to location specified by resource locator
+ *
+ * @param locator location where to store the data
+ * @param options operation options
+ * @param resource the resource to save
+ * @return status
+ */
+ public IResourceLocator save(IResourceLocator locator, IResource resource, Options options) throws OseeCoreException;
+
+ /**
+ * Delete resource specified by resource locator
+ *
+ * @param locator location of the resource to delete
+ * @return status
+ */
+ public int delete(IResourceLocator locator) throws OseeCoreException;
+
+ /**
+ * Get provider supported protocols
+ *
+ * @return supported protocols
+ */
+ public Collection<String> getSupportedProtocols();
+}
diff --git a/plugins/org.eclipse.osee.framework.resource.management/src/org/eclipse/osee/framework/resource/management/Options.java b/plugins/org.eclipse.osee.framework.resource.management/src/org/eclipse/osee/framework/resource/management/Options.java
index b3efd7ae39..7a4fef612c 100644
--- a/plugins/org.eclipse.osee.framework.resource.management/src/org/eclipse/osee/framework/resource/management/Options.java
+++ b/plugins/org.eclipse.osee.framework.resource.management/src/org/eclipse/osee/framework/resource/management/Options.java
@@ -1,30 +1,30 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2007 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.framework.resource.management;
-
-import org.eclipse.osee.framework.jdk.core.type.PropertyStore;
-
-/**
- * @author Roberto E. Escobar
- */
-public class Options extends PropertyStore {
-
- private static final long serialVersionUID = -8556523292740896103L;
-
- public Options() {
- super();
- }
-
- public void clear() {
- getItems().clear();
- getArrays().clear();
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.framework.resource.management;
+
+import org.eclipse.osee.framework.jdk.core.type.PropertyStore;
+
+/**
+ * @author Roberto E. Escobar
+ */
+public class Options extends PropertyStore {
+
+ private static final long serialVersionUID = -8556523292740896103L;
+
+ public Options() {
+ super();
+ }
+
+ public void clear() {
+ getItems().clear();
+ getArrays().clear();
+ }
+}
diff --git a/plugins/org.eclipse.osee.framework.resource.management/src/org/eclipse/osee/framework/resource/management/StandardOptions.java b/plugins/org.eclipse.osee.framework.resource.management/src/org/eclipse/osee/framework/resource/management/StandardOptions.java
index b09a2ccf3d..a901883e32 100644
--- a/plugins/org.eclipse.osee.framework.resource.management/src/org/eclipse/osee/framework/resource/management/StandardOptions.java
+++ b/plugins/org.eclipse.osee.framework.resource.management/src/org/eclipse/osee/framework/resource/management/StandardOptions.java
@@ -1,18 +1,18 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2007 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.framework.resource.management;
-
-/**
- * @author Roberto E. Escobar
- */
-public enum StandardOptions {
- CompressOnSave, CompressOnAcquire, DecompressOnSave, DecompressOnAquire, Overwrite, Extension;
-}
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.framework.resource.management;
+
+/**
+ * @author Roberto E. Escobar
+ */
+public enum StandardOptions {
+ CompressOnSave, CompressOnAcquire, DecompressOnSave, DecompressOnAquire, Overwrite, Extension;
+}
diff --git a/plugins/org.eclipse.osee.framework.resource.management/src/org/eclipse/osee/framework/resource/management/exception/EmptyResourceException.java b/plugins/org.eclipse.osee.framework.resource.management/src/org/eclipse/osee/framework/resource/management/exception/EmptyResourceException.java
index f0c1dd9428..21785b27e3 100644
--- a/plugins/org.eclipse.osee.framework.resource.management/src/org/eclipse/osee/framework/resource/management/exception/EmptyResourceException.java
+++ b/plugins/org.eclipse.osee.framework.resource.management/src/org/eclipse/osee/framework/resource/management/exception/EmptyResourceException.java
@@ -1,33 +1,33 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2007 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.framework.resource.management.exception;
-
-import org.eclipse.osee.framework.core.exception.OseeCoreException;
-
-/**
- * @author Roberto E. Escobar
- */
-public class EmptyResourceException extends OseeCoreException {
-
- private static final long serialVersionUID = 262834138993880676L;
-
- public EmptyResourceException(String message, Throwable cause) {
- super(message, cause);
- }
-
- public EmptyResourceException(String message) {
- super(message);
- }
-
- public EmptyResourceException(Throwable cause) {
- super(cause);
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.framework.resource.management.exception;
+
+import org.eclipse.osee.framework.core.exception.OseeCoreException;
+
+/**
+ * @author Roberto E. Escobar
+ */
+public class EmptyResourceException extends OseeCoreException {
+
+ private static final long serialVersionUID = 262834138993880676L;
+
+ public EmptyResourceException(String message, Throwable cause) {
+ super(message, cause);
+ }
+
+ public EmptyResourceException(String message) {
+ super(message);
+ }
+
+ public EmptyResourceException(Throwable cause) {
+ super(cause);
+ }
+}
diff --git a/plugins/org.eclipse.osee.framework.resource.management/src/org/eclipse/osee/framework/resource/management/exception/InvalidLocatorException.java b/plugins/org.eclipse.osee.framework.resource.management/src/org/eclipse/osee/framework/resource/management/exception/InvalidLocatorException.java
index bba53e0ef7..3a16fb110e 100644
--- a/plugins/org.eclipse.osee.framework.resource.management/src/org/eclipse/osee/framework/resource/management/exception/InvalidLocatorException.java
+++ b/plugins/org.eclipse.osee.framework.resource.management/src/org/eclipse/osee/framework/resource/management/exception/InvalidLocatorException.java
@@ -1,34 +1,34 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2007 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.framework.resource.management.exception;
-
-import org.eclipse.osee.framework.core.exception.OseeCoreException;
-
-/**
- * @author Roberto E. Escobar
- */
-public class InvalidLocatorException extends OseeCoreException {
-
- private static final long serialVersionUID = -1291325728313575694L;
-
- public InvalidLocatorException(String message, Throwable cause) {
- super(message, cause);
- }
-
- public InvalidLocatorException(String message) {
- super(message);
- }
-
- public InvalidLocatorException(Throwable cause) {
- super(cause);
- }
-
-}
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.framework.resource.management.exception;
+
+import org.eclipse.osee.framework.core.exception.OseeCoreException;
+
+/**
+ * @author Roberto E. Escobar
+ */
+public class InvalidLocatorException extends OseeCoreException {
+
+ private static final long serialVersionUID = -1291325728313575694L;
+
+ public InvalidLocatorException(String message, Throwable cause) {
+ super(message, cause);
+ }
+
+ public InvalidLocatorException(String message) {
+ super(message);
+ }
+
+ public InvalidLocatorException(Throwable cause) {
+ super(cause);
+ }
+
+}
diff --git a/plugins/org.eclipse.osee.framework.resource.management/src/org/eclipse/osee/framework/resource/management/exception/MalformedLocatorException.java b/plugins/org.eclipse.osee.framework.resource.management/src/org/eclipse/osee/framework/resource/management/exception/MalformedLocatorException.java
index 4f1229af81..52c84b9bb1 100644
--- a/plugins/org.eclipse.osee.framework.resource.management/src/org/eclipse/osee/framework/resource/management/exception/MalformedLocatorException.java
+++ b/plugins/org.eclipse.osee.framework.resource.management/src/org/eclipse/osee/framework/resource/management/exception/MalformedLocatorException.java
@@ -1,44 +1,44 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2007 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.framework.resource.management.exception;
-
-import org.eclipse.osee.framework.core.exception.OseeCoreException;
-
-/**
- * @author Roberto E. Escobar
- */
-public class MalformedLocatorException extends OseeCoreException {
-
- private static final long serialVersionUID = -7595802736847790150L;
-
- /**
- * @param message
- * @param cause
- */
- public MalformedLocatorException(String message, Throwable cause) {
- super(message, cause);
- }
-
- /**
- * @param message
- */
- public MalformedLocatorException(String message) {
- super(message);
- }
-
- /**
- * @param cause
- */
- public MalformedLocatorException(Throwable cause) {
- super(cause);
- }
-
-}
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.framework.resource.management.exception;
+
+import org.eclipse.osee.framework.core.exception.OseeCoreException;
+
+/**
+ * @author Roberto E. Escobar
+ */
+public class MalformedLocatorException extends OseeCoreException {
+
+ private static final long serialVersionUID = -7595802736847790150L;
+
+ /**
+ * @param message
+ * @param cause
+ */
+ public MalformedLocatorException(String message, Throwable cause) {
+ super(message, cause);
+ }
+
+ /**
+ * @param message
+ */
+ public MalformedLocatorException(String message) {
+ super(message);
+ }
+
+ /**
+ * @param cause
+ */
+ public MalformedLocatorException(Throwable cause) {
+ super(cause);
+ }
+
+}
diff --git a/plugins/org.eclipse.osee.framework.resource.management/src/org/eclipse/osee/framework/resource/management/internal/CompressedResourceBridge.java b/plugins/org.eclipse.osee.framework.resource.management/src/org/eclipse/osee/framework/resource/management/internal/CompressedResourceBridge.java
index 6a075200c7..8b8bed173f 100644
--- a/plugins/org.eclipse.osee.framework.resource.management/src/org/eclipse/osee/framework/resource/management/internal/CompressedResourceBridge.java
+++ b/plugins/org.eclipse.osee.framework.resource.management/src/org/eclipse/osee/framework/resource/management/internal/CompressedResourceBridge.java
@@ -1,54 +1,54 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2007 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.framework.resource.management.internal;
-
-import java.io.ByteArrayInputStream;
-import java.io.InputStream;
-import java.net.URI;
-import org.eclipse.osee.framework.core.exception.OseeCoreException;
-import org.eclipse.osee.framework.resource.management.IResource;
-
-/**
- * @author Roberto E. Escobar
- */
-public class CompressedResourceBridge implements IResource {
- private final byte[] backing;
- private final boolean isCompressed;
- private final URI uri;
-
- public CompressedResourceBridge(byte[] backing, URI uri, boolean isCompressed) {
- this.backing = backing;
- this.isCompressed = isCompressed;
- this.uri = uri;
- }
-
- @Override
- public InputStream getContent() throws OseeCoreException {
- return new ByteArrayInputStream(backing);
- }
-
- @Override
- public URI getLocation() {
- return uri;
- }
-
- @Override
- public String getName() {
- String value = uri.toASCIIString();
- return value.substring(value.lastIndexOf("/") + 1, value.length());
- }
-
- @Override
- public boolean isCompressed() {
- return isCompressed;
- }
-
-}
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.framework.resource.management.internal;
+
+import java.io.ByteArrayInputStream;
+import java.io.InputStream;
+import java.net.URI;
+import org.eclipse.osee.framework.core.exception.OseeCoreException;
+import org.eclipse.osee.framework.resource.management.IResource;
+
+/**
+ * @author Roberto E. Escobar
+ */
+public class CompressedResourceBridge implements IResource {
+ private final byte[] backing;
+ private final boolean isCompressed;
+ private final URI uri;
+
+ public CompressedResourceBridge(byte[] backing, URI uri, boolean isCompressed) {
+ this.backing = backing;
+ this.isCompressed = isCompressed;
+ this.uri = uri;
+ }
+
+ @Override
+ public InputStream getContent() throws OseeCoreException {
+ return new ByteArrayInputStream(backing);
+ }
+
+ @Override
+ public URI getLocation() {
+ return uri;
+ }
+
+ @Override
+ public String getName() {
+ String value = uri.toASCIIString();
+ return value.substring(value.lastIndexOf("/") + 1, value.length());
+ }
+
+ @Override
+ public boolean isCompressed() {
+ return isCompressed;
+ }
+
+}
diff --git a/plugins/org.eclipse.osee.framework.resource.management/src/org/eclipse/osee/framework/resource/management/internal/ResourceLocatorManager.java b/plugins/org.eclipse.osee.framework.resource.management/src/org/eclipse/osee/framework/resource/management/internal/ResourceLocatorManager.java
index 3d5c9ef1e1..34a234284b 100644
--- a/plugins/org.eclipse.osee.framework.resource.management/src/org/eclipse/osee/framework/resource/management/internal/ResourceLocatorManager.java
+++ b/plugins/org.eclipse.osee.framework.resource.management/src/org/eclipse/osee/framework/resource/management/internal/ResourceLocatorManager.java
@@ -1,83 +1,83 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2007 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.framework.resource.management.internal;
-
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.Set;
-import java.util.concurrent.CopyOnWriteArraySet;
-import org.eclipse.osee.framework.core.exception.OseeCoreException;
-import org.eclipse.osee.framework.core.exception.OseeStateException;
-import org.eclipse.osee.framework.resource.management.IResourceLocator;
-import org.eclipse.osee.framework.resource.management.IResourceLocatorManager;
-import org.eclipse.osee.framework.resource.management.IResourceLocatorProvider;
-import org.eclipse.osee.framework.resource.management.exception.MalformedLocatorException;
-
-/**
- * @author Roberto E. Escobar
- */
-public class ResourceLocatorManager implements IResourceLocatorManager {
-
- private final Collection<IResourceLocatorProvider> resourceLocatorProviders;
-
- public ResourceLocatorManager() {
- this.resourceLocatorProviders = new CopyOnWriteArraySet<IResourceLocatorProvider>();
- }
-
- @Override
- public Collection<String> getProtocols() {
- Set<String> protocols = new HashSet<String>();
- for (IResourceLocatorProvider provider : resourceLocatorProviders) {
- protocols.add(provider.getSupportedProtocol());
- }
- return protocols;
- }
-
- @Override
- public boolean addResourceLocatorProvider(IResourceLocatorProvider resourceLocatorProvider) {
- return this.resourceLocatorProviders.add(resourceLocatorProvider);
- }
-
- @Override
- public boolean removeResourceLocatorProvider(IResourceLocatorProvider resourceLocatorProvider) {
- return this.resourceLocatorProviders.remove(resourceLocatorProvider);
- }
-
- @Override
- public IResourceLocator generateResourceLocator(String protocol, String seed, String name) throws OseeCoreException {
- IResourceLocatorProvider resourceLocatorProvider = getProvider(protocol);
- return resourceLocatorProvider.generateResourceLocator(seed, name);
- }
-
- @Override
- public IResourceLocator getResourceLocator(String path) throws OseeCoreException {
- IResourceLocatorProvider resourceLocatorProvider = getProvider(path);
- return resourceLocatorProvider.getResourceLocator(path);
- }
-
- private IResourceLocatorProvider getProvider(String protocol) throws OseeCoreException {
- if (resourceLocatorProviders.isEmpty()) {
- throw new OseeStateException("Resource locator providers are not available");
- }
- IResourceLocatorProvider toReturn = null;
- for (IResourceLocatorProvider provider : resourceLocatorProviders) {
- if (provider.isValid(protocol)) {
- toReturn = provider;
- break;
- }
- }
- if (toReturn == null) {
- throw new MalformedLocatorException(String.format("Error finding locator for [%s] in [%s]", protocol,
- resourceLocatorProviders));
- }
- return toReturn;
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.framework.resource.management.internal;
+
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Set;
+import java.util.concurrent.CopyOnWriteArraySet;
+import org.eclipse.osee.framework.core.exception.OseeCoreException;
+import org.eclipse.osee.framework.core.exception.OseeStateException;
+import org.eclipse.osee.framework.resource.management.IResourceLocator;
+import org.eclipse.osee.framework.resource.management.IResourceLocatorManager;
+import org.eclipse.osee.framework.resource.management.IResourceLocatorProvider;
+import org.eclipse.osee.framework.resource.management.exception.MalformedLocatorException;
+
+/**
+ * @author Roberto E. Escobar
+ */
+public class ResourceLocatorManager implements IResourceLocatorManager {
+
+ private final Collection<IResourceLocatorProvider> resourceLocatorProviders;
+
+ public ResourceLocatorManager() {
+ this.resourceLocatorProviders = new CopyOnWriteArraySet<IResourceLocatorProvider>();
+ }
+
+ @Override
+ public Collection<String> getProtocols() {
+ Set<String> protocols = new HashSet<String>();
+ for (IResourceLocatorProvider provider : resourceLocatorProviders) {
+ protocols.add(provider.getSupportedProtocol());
+ }
+ return protocols;
+ }
+
+ @Override
+ public boolean addResourceLocatorProvider(IResourceLocatorProvider resourceLocatorProvider) {
+ return this.resourceLocatorProviders.add(resourceLocatorProvider);
+ }
+
+ @Override
+ public boolean removeResourceLocatorProvider(IResourceLocatorProvider resourceLocatorProvider) {
+ return this.resourceLocatorProviders.remove(resourceLocatorProvider);
+ }
+
+ @Override
+ public IResourceLocator generateResourceLocator(String protocol, String seed, String name) throws OseeCoreException {
+ IResourceLocatorProvider resourceLocatorProvider = getProvider(protocol);
+ return resourceLocatorProvider.generateResourceLocator(seed, name);
+ }
+
+ @Override
+ public IResourceLocator getResourceLocator(String path) throws OseeCoreException {
+ IResourceLocatorProvider resourceLocatorProvider = getProvider(path);
+ return resourceLocatorProvider.getResourceLocator(path);
+ }
+
+ private IResourceLocatorProvider getProvider(String protocol) throws OseeCoreException {
+ if (resourceLocatorProviders.isEmpty()) {
+ throw new OseeStateException("Resource locator providers are not available");
+ }
+ IResourceLocatorProvider toReturn = null;
+ for (IResourceLocatorProvider provider : resourceLocatorProviders) {
+ if (provider.isValid(protocol)) {
+ toReturn = provider;
+ break;
+ }
+ }
+ if (toReturn == null) {
+ throw new MalformedLocatorException(String.format("Error finding locator for [%s] in [%s]", protocol,
+ resourceLocatorProviders));
+ }
+ return toReturn;
+ }
+}
diff --git a/plugins/org.eclipse.osee.framework.resource.management/src/org/eclipse/osee/framework/resource/management/internal/ResourceManager.java b/plugins/org.eclipse.osee.framework.resource.management/src/org/eclipse/osee/framework/resource/management/internal/ResourceManager.java
index f503c166a5..d555aa644d 100644
--- a/plugins/org.eclipse.osee.framework.resource.management/src/org/eclipse/osee/framework/resource/management/internal/ResourceManager.java
+++ b/plugins/org.eclipse.osee.framework.resource.management/src/org/eclipse/osee/framework/resource/management/internal/ResourceManager.java
@@ -1,136 +1,136 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2007 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.framework.resource.management.internal;
-
-import java.util.Collection;
-import java.util.concurrent.CopyOnWriteArraySet;
-import org.eclipse.osee.framework.core.exception.OseeCoreException;
-import org.eclipse.osee.framework.resource.management.IResource;
-import org.eclipse.osee.framework.resource.management.IResourceListener;
-import org.eclipse.osee.framework.resource.management.IResourceLocator;
-import org.eclipse.osee.framework.resource.management.IResourceManager;
-import org.eclipse.osee.framework.resource.management.IResourceProvider;
-import org.eclipse.osee.framework.resource.management.Options;
-import org.eclipse.osee.framework.resource.management.exception.InvalidLocatorException;
-
-/**
- * @author Roberto E. Escobar
- */
-public class ResourceManager implements IResourceManager {
-
- private final Collection<IResourceListener> listeners;
- private final Collection<IResourceProvider> resourceProviders;
-
- public ResourceManager() {
- this.listeners = new CopyOnWriteArraySet<IResourceListener>();
- this.resourceProviders = new CopyOnWriteArraySet<IResourceProvider>();
- }
-
- @Override
- public boolean addResourceListener(IResourceListener listener) {
- return listeners.add(listener);
- }
-
- public boolean removeResourceListener(IResourceListener listener) {
- return listeners.remove(listener);
- }
-
- private void notifyPreOnDelete(final IResourceLocator locator) {
- for (IResourceListener listener : listeners) {
- listener.onPreDelete(locator);
- }
- }
-
- private void notifyPostOnDelete(final IResourceLocator locator) {
- for (IResourceListener listener : listeners) {
- listener.onPostDelete(locator);
- }
- }
-
- private void notifyPreOnSave(final IResourceLocator locator, IResource resource, Options options) {
- for (IResourceListener listener : listeners) {
- listener.onPreSave(locator, resource, options);
- }
- }
-
- private void notifyPostOnSave(IResourceLocator locator, final IResource resource, Options options) {
- for (IResourceListener listener : listeners) {
- listener.onPostSave(locator, resource, options);
- }
- }
-
- private void notifyPreOnAcquire(final IResourceLocator locator) {
- for (IResourceListener listener : listeners) {
- listener.onPreAcquire(locator);
- }
- }
-
- private void notifyPostOnAcquire(final IResource resource) {
- for (IResourceListener listener : listeners) {
- listener.onPostAcquire(resource);
- }
- }
-
- private IResourceProvider getProvider(IResourceLocator locator) throws OseeCoreException {
- IResourceProvider toReturn = null;
- for (IResourceProvider provider : resourceProviders) {
- if (provider.isValid(locator) != false) {
- toReturn = provider;
- break;
- }
- }
- if (toReturn == null) {
- throw new InvalidLocatorException(String.format("Invalid Locator: [%s]", locator));
- }
- return toReturn;
- }
-
- @Override
- public boolean addResourceProvider(IResourceProvider resourceProvider) {
- return resourceProviders.add(resourceProvider);
- }
-
- @Override
- public boolean removeResourceProvider(IResourceProvider resourceProvider) {
- return resourceProviders.remove(resourceProvider);
- }
-
- public IResource acquire(IResourceLocator locator, Options options) throws OseeCoreException {
- IResourceProvider provider = getProvider(locator);
- notifyPreOnAcquire(locator);
- IResource toReturn = provider.acquire(locator, options);
- notifyPostOnAcquire(toReturn);
- return toReturn;
- }
-
- public IResourceLocator save(IResourceLocator locator, IResource resource, Options options) throws OseeCoreException {
- IResourceProvider provider = getProvider(locator);
- notifyPreOnSave(locator, resource, options);
- IResourceLocator actualLocator = provider.save(locator, resource, options);
- notifyPostOnSave(locator, resource, options);
- return actualLocator;
- }
-
- public int delete(IResourceLocator locator) throws OseeCoreException {
- int toReturn = IResourceManager.FAIL;
- IResourceProvider provider = getProvider(locator);
- notifyPreOnDelete(locator);
- toReturn = provider.delete(locator);
- notifyPostOnDelete(locator);
- return toReturn;
- }
-
- @Override
- public boolean exists(IResourceLocator locator) throws OseeCoreException {
- IResourceProvider provider = getProvider(locator);
- return provider.exists(locator);
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.framework.resource.management.internal;
+
+import java.util.Collection;
+import java.util.concurrent.CopyOnWriteArraySet;
+import org.eclipse.osee.framework.core.exception.OseeCoreException;
+import org.eclipse.osee.framework.resource.management.IResource;
+import org.eclipse.osee.framework.resource.management.IResourceListener;
+import org.eclipse.osee.framework.resource.management.IResourceLocator;
+import org.eclipse.osee.framework.resource.management.IResourceManager;
+import org.eclipse.osee.framework.resource.management.IResourceProvider;
+import org.eclipse.osee.framework.resource.management.Options;
+import org.eclipse.osee.framework.resource.management.exception.InvalidLocatorException;
+
+/**
+ * @author Roberto E. Escobar
+ */
+public class ResourceManager implements IResourceManager {
+
+ private final Collection<IResourceListener> listeners;
+ private final Collection<IResourceProvider> resourceProviders;
+
+ public ResourceManager() {
+ this.listeners = new CopyOnWriteArraySet<IResourceListener>();
+ this.resourceProviders = new CopyOnWriteArraySet<IResourceProvider>();
+ }
+
+ @Override
+ public boolean addResourceListener(IResourceListener listener) {
+ return listeners.add(listener);
+ }
+
+ public boolean removeResourceListener(IResourceListener listener) {
+ return listeners.remove(listener);
+ }
+
+ private void notifyPreOnDelete(final IResourceLocator locator) {
+ for (IResourceListener listener : listeners) {
+ listener.onPreDelete(locator);
+ }
+ }
+
+ private void notifyPostOnDelete(final IResourceLocator locator) {
+ for (IResourceListener listener : listeners) {
+ listener.onPostDelete(locator);
+ }
+ }
+
+ private void notifyPreOnSave(final IResourceLocator locator, IResource resource, Options options) {
+ for (IResourceListener listener : listeners) {
+ listener.onPreSave(locator, resource, options);
+ }
+ }
+
+ private void notifyPostOnSave(IResourceLocator locator, final IResource resource, Options options) {
+ for (IResourceListener listener : listeners) {
+ listener.onPostSave(locator, resource, options);
+ }
+ }
+
+ private void notifyPreOnAcquire(final IResourceLocator locator) {
+ for (IResourceListener listener : listeners) {
+ listener.onPreAcquire(locator);
+ }
+ }
+
+ private void notifyPostOnAcquire(final IResource resource) {
+ for (IResourceListener listener : listeners) {
+ listener.onPostAcquire(resource);
+ }
+ }
+
+ private IResourceProvider getProvider(IResourceLocator locator) throws OseeCoreException {
+ IResourceProvider toReturn = null;
+ for (IResourceProvider provider : resourceProviders) {
+ if (provider.isValid(locator) != false) {
+ toReturn = provider;
+ break;
+ }
+ }
+ if (toReturn == null) {
+ throw new InvalidLocatorException(String.format("Invalid Locator: [%s]", locator));
+ }
+ return toReturn;
+ }
+
+ @Override
+ public boolean addResourceProvider(IResourceProvider resourceProvider) {
+ return resourceProviders.add(resourceProvider);
+ }
+
+ @Override
+ public boolean removeResourceProvider(IResourceProvider resourceProvider) {
+ return resourceProviders.remove(resourceProvider);
+ }
+
+ public IResource acquire(IResourceLocator locator, Options options) throws OseeCoreException {
+ IResourceProvider provider = getProvider(locator);
+ notifyPreOnAcquire(locator);
+ IResource toReturn = provider.acquire(locator, options);
+ notifyPostOnAcquire(toReturn);
+ return toReturn;
+ }
+
+ public IResourceLocator save(IResourceLocator locator, IResource resource, Options options) throws OseeCoreException {
+ IResourceProvider provider = getProvider(locator);
+ notifyPreOnSave(locator, resource, options);
+ IResourceLocator actualLocator = provider.save(locator, resource, options);
+ notifyPostOnSave(locator, resource, options);
+ return actualLocator;
+ }
+
+ public int delete(IResourceLocator locator) throws OseeCoreException {
+ int toReturn = IResourceManager.FAIL;
+ IResourceProvider provider = getProvider(locator);
+ notifyPreOnDelete(locator);
+ toReturn = provider.delete(locator);
+ notifyPostOnDelete(locator);
+ return toReturn;
+ }
+
+ @Override
+ public boolean exists(IResourceLocator locator) throws OseeCoreException {
+ IResourceProvider provider = getProvider(locator);
+ return provider.exists(locator);
+ }
+}
diff --git a/plugins/org.eclipse.osee.framework.resource.management/src/org/eclipse/osee/framework/resource/management/util/OptionsProcessor.java b/plugins/org.eclipse.osee.framework.resource.management/src/org/eclipse/osee/framework/resource/management/util/OptionsProcessor.java
index 50dfcce738..ae73ae7650 100644
--- a/plugins/org.eclipse.osee.framework.resource.management/src/org/eclipse/osee/framework/resource/management/util/OptionsProcessor.java
+++ b/plugins/org.eclipse.osee.framework.resource.management/src/org/eclipse/osee/framework/resource/management/util/OptionsProcessor.java
@@ -1,122 +1,122 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2007 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.framework.resource.management.util;
-
-import java.io.File;
-import java.net.URI;
-import java.net.URISyntaxException;
-import org.eclipse.osee.framework.core.exception.OseeCoreException;
-import org.eclipse.osee.framework.core.exception.OseeStateException;
-import org.eclipse.osee.framework.jdk.core.util.Lib;
-import org.eclipse.osee.framework.jdk.core.util.Strings;
-import org.eclipse.osee.framework.resource.management.IResource;
-import org.eclipse.osee.framework.resource.management.IResourceLocator;
-import org.eclipse.osee.framework.resource.management.Options;
-import org.eclipse.osee.framework.resource.management.StandardOptions;
-import org.eclipse.osee.framework.resource.management.exception.MalformedLocatorException;
-
-/**
- * @author Andrew M. Finkbeiner
- */
-public class OptionsProcessor {
-
- private final URI fileuri;
- private final URI locatoruri;
- private final IResource resource;
- private final String extension;
- private final boolean deCompressOnSave;
- private final boolean shouldCompress;
- private final boolean decompressOnAcquire;
- private final boolean compressOnAcquire;
- private final boolean overwrite;
-
- public OptionsProcessor(URI uri, IResourceLocator locator, IResource resource, Options options) throws MalformedLocatorException {
- this.resource = resource;
- decompressOnAcquire = options.getBoolean(StandardOptions.DecompressOnAquire.name());
- compressOnAcquire = options.getBoolean(StandardOptions.CompressOnAcquire.name());
- overwrite = options.getBoolean(StandardOptions.Overwrite.name());
- shouldCompress = options.getBoolean(StandardOptions.CompressOnSave.name());
- deCompressOnSave = options.getBoolean(StandardOptions.DecompressOnSave.name());
- extension = options.get(StandardOptions.Extension.name());
-
- StringBuilder sb = new StringBuilder(uri.toString());
- StringBuilder sb2 = new StringBuilder(locator.toString());
- if (Strings.isValid(extension)) {
- sb.append(".");
- sb.append(extension);
- sb2.append(".");
- sb2.append(extension);
- }
- if (shouldCompress) {
- sb.append(".");
- sb.append("zip");
- sb2.append(".");
- sb2.append("zip");
- }
- try {
- this.fileuri = new URI(sb.toString());
- } catch (URISyntaxException ex) {
- throw new MalformedLocatorException(sb.toString(), ex);
- }
- try {
- this.locatoruri = new URI(sb2.toString());
- } catch (URISyntaxException ex) {
- throw new MalformedLocatorException(sb2.toString(), ex);
- }
- }
-
- public File getStorageFile() throws OseeCoreException {
- File storageFile = new File(fileuri);
- if (!overwrite) {
- if (storageFile.exists()) {
- throw new OseeStateException(String.format("The file [%s] already exists.", storageFile.getAbsolutePath()));
- }
- }
- File parent = storageFile.getParentFile();
- if (parent != null && !parent.exists()) {
- parent.mkdirs();
- }
- return storageFile;
- }
-
- public IResource getResourceToStore() throws OseeCoreException {
- IResource resourceToReturn;
- if (shouldCompress && !resource.isCompressed()) {
- resourceToReturn = Resources.compressResource(resource);
- } else if (deCompressOnSave && resource.isCompressed()) {
- resourceToReturn = Resources.decompressResource(resource);
- } else {
- resourceToReturn = resource;
- }
- return resourceToReturn;
- }
-
- public IResource getResourceToServer() throws OseeCoreException {
- IResource toReturn = null;
- File testFile = new File(this.fileuri);
- if (testFile != null && testFile.exists() != false) {
- boolean isCompressed = Lib.isCompressed(testFile);
- toReturn = new Resource(this.fileuri, isCompressed);
-
- if (compressOnAcquire && !isCompressed) {
- toReturn = Resources.compressResource(toReturn);
- } else if (decompressOnAcquire && isCompressed) {
- toReturn = Resources.decompressResource(toReturn);
- }
- }
- return toReturn;
- }
-
- public IResourceLocator getActualResouceLocator() throws OseeCoreException {
- return new ResourceLocator(this.locatoruri);
- }
-
-}
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.framework.resource.management.util;
+
+import java.io.File;
+import java.net.URI;
+import java.net.URISyntaxException;
+import org.eclipse.osee.framework.core.exception.OseeCoreException;
+import org.eclipse.osee.framework.core.exception.OseeStateException;
+import org.eclipse.osee.framework.jdk.core.util.Lib;
+import org.eclipse.osee.framework.jdk.core.util.Strings;
+import org.eclipse.osee.framework.resource.management.IResource;
+import org.eclipse.osee.framework.resource.management.IResourceLocator;
+import org.eclipse.osee.framework.resource.management.Options;
+import org.eclipse.osee.framework.resource.management.StandardOptions;
+import org.eclipse.osee.framework.resource.management.exception.MalformedLocatorException;
+
+/**
+ * @author Andrew M. Finkbeiner
+ */
+public class OptionsProcessor {
+
+ private final URI fileuri;
+ private final URI locatoruri;
+ private final IResource resource;
+ private final String extension;
+ private final boolean deCompressOnSave;
+ private final boolean shouldCompress;
+ private final boolean decompressOnAcquire;
+ private final boolean compressOnAcquire;
+ private final boolean overwrite;
+
+ public OptionsProcessor(URI uri, IResourceLocator locator, IResource resource, Options options) throws MalformedLocatorException {
+ this.resource = resource;
+ decompressOnAcquire = options.getBoolean(StandardOptions.DecompressOnAquire.name());
+ compressOnAcquire = options.getBoolean(StandardOptions.CompressOnAcquire.name());
+ overwrite = options.getBoolean(StandardOptions.Overwrite.name());
+ shouldCompress = options.getBoolean(StandardOptions.CompressOnSave.name());
+ deCompressOnSave = options.getBoolean(StandardOptions.DecompressOnSave.name());
+ extension = options.get(StandardOptions.Extension.name());
+
+ StringBuilder sb = new StringBuilder(uri.toString());
+ StringBuilder sb2 = new StringBuilder(locator.toString());
+ if (Strings.isValid(extension)) {
+ sb.append(".");
+ sb.append(extension);
+ sb2.append(".");
+ sb2.append(extension);
+ }
+ if (shouldCompress) {
+ sb.append(".");
+ sb.append("zip");
+ sb2.append(".");
+ sb2.append("zip");
+ }
+ try {
+ this.fileuri = new URI(sb.toString());
+ } catch (URISyntaxException ex) {
+ throw new MalformedLocatorException(sb.toString(), ex);
+ }
+ try {
+ this.locatoruri = new URI(sb2.toString());
+ } catch (URISyntaxException ex) {
+ throw new MalformedLocatorException(sb2.toString(), ex);
+ }
+ }
+
+ public File getStorageFile() throws OseeCoreException {
+ File storageFile = new File(fileuri);
+ if (!overwrite) {
+ if (storageFile.exists()) {
+ throw new OseeStateException(String.format("The file [%s] already exists.", storageFile.getAbsolutePath()));
+ }
+ }
+ File parent = storageFile.getParentFile();
+ if (parent != null && !parent.exists()) {
+ parent.mkdirs();
+ }
+ return storageFile;
+ }
+
+ public IResource getResourceToStore() throws OseeCoreException {
+ IResource resourceToReturn;
+ if (shouldCompress && !resource.isCompressed()) {
+ resourceToReturn = Resources.compressResource(resource);
+ } else if (deCompressOnSave && resource.isCompressed()) {
+ resourceToReturn = Resources.decompressResource(resource);
+ } else {
+ resourceToReturn = resource;
+ }
+ return resourceToReturn;
+ }
+
+ public IResource getResourceToServer() throws OseeCoreException {
+ IResource toReturn = null;
+ File testFile = new File(this.fileuri);
+ if (testFile != null && testFile.exists() != false) {
+ boolean isCompressed = Lib.isCompressed(testFile);
+ toReturn = new Resource(this.fileuri, isCompressed);
+
+ if (compressOnAcquire && !isCompressed) {
+ toReturn = Resources.compressResource(toReturn);
+ } else if (decompressOnAcquire && isCompressed) {
+ toReturn = Resources.decompressResource(toReturn);
+ }
+ }
+ return toReturn;
+ }
+
+ public IResourceLocator getActualResouceLocator() throws OseeCoreException {
+ return new ResourceLocator(this.locatoruri);
+ }
+
+}
diff --git a/plugins/org.eclipse.osee.framework.resource.management/src/org/eclipse/osee/framework/resource/management/util/Resource.java b/plugins/org.eclipse.osee.framework.resource.management/src/org/eclipse/osee/framework/resource/management/util/Resource.java
index 468b9ec2c8..63104653e6 100644
--- a/plugins/org.eclipse.osee.framework.resource.management/src/org/eclipse/osee/framework/resource/management/util/Resource.java
+++ b/plugins/org.eclipse.osee.framework.resource.management/src/org/eclipse/osee/framework/resource/management/util/Resource.java
@@ -1,56 +1,56 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2007 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.framework.resource.management.util;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URI;
-import org.eclipse.osee.framework.core.exception.OseeCoreException;
-import org.eclipse.osee.framework.core.exception.OseeExceptions;
-import org.eclipse.osee.framework.resource.management.IResource;
-
-/**
- * @author Roberto E. Escobar
- */
-public class Resource implements IResource {
- private final URI uri;
- private final boolean isCompressed;
-
- public Resource(URI uri, boolean isCompressed) {
- this.uri = uri;
- this.isCompressed = isCompressed;
- }
-
- public InputStream getContent() throws OseeCoreException {
- InputStream stream = null;
- try {
- stream = uri.toURL().openStream();
- } catch (IOException ex) {
- OseeExceptions.wrapAndThrow(ex);
- }
- return stream;
- }
-
- public URI getLocation() {
- return uri;
- }
-
- @Override
- public String getName() {
- String value = uri.toASCIIString();
- return value.substring(value.lastIndexOf("/") + 1, value.length());
- }
-
- @Override
- public boolean isCompressed() {
- return isCompressed;
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.framework.resource.management.util;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URI;
+import org.eclipse.osee.framework.core.exception.OseeCoreException;
+import org.eclipse.osee.framework.core.exception.OseeExceptions;
+import org.eclipse.osee.framework.resource.management.IResource;
+
+/**
+ * @author Roberto E. Escobar
+ */
+public class Resource implements IResource {
+ private final URI uri;
+ private final boolean isCompressed;
+
+ public Resource(URI uri, boolean isCompressed) {
+ this.uri = uri;
+ this.isCompressed = isCompressed;
+ }
+
+ public InputStream getContent() throws OseeCoreException {
+ InputStream stream = null;
+ try {
+ stream = uri.toURL().openStream();
+ } catch (IOException ex) {
+ OseeExceptions.wrapAndThrow(ex);
+ }
+ return stream;
+ }
+
+ public URI getLocation() {
+ return uri;
+ }
+
+ @Override
+ public String getName() {
+ String value = uri.toASCIIString();
+ return value.substring(value.lastIndexOf("/") + 1, value.length());
+ }
+
+ @Override
+ public boolean isCompressed() {
+ return isCompressed;
+ }
+}
diff --git a/plugins/org.eclipse.osee.framework.resource.management/src/org/eclipse/osee/framework/resource/management/util/ResourceLocator.java b/plugins/org.eclipse.osee.framework.resource.management/src/org/eclipse/osee/framework/resource/management/util/ResourceLocator.java
index 2871eaa09b..1b81ab3c27 100644
--- a/plugins/org.eclipse.osee.framework.resource.management/src/org/eclipse/osee/framework/resource/management/util/ResourceLocator.java
+++ b/plugins/org.eclipse.osee.framework.resource.management/src/org/eclipse/osee/framework/resource/management/util/ResourceLocator.java
@@ -1,53 +1,53 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2007 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.framework.resource.management.util;
-
-import java.net.URI;
-import org.eclipse.osee.framework.core.exception.OseeArgumentException;
-import org.eclipse.osee.framework.core.exception.OseeCoreException;
-import org.eclipse.osee.framework.resource.management.IResourceLocator;
-
-/**
- * @author Roberto E. Escobar
- */
-public class ResourceLocator implements IResourceLocator {
-
- private final URI uri;
-
- public ResourceLocator(URI uri) throws OseeCoreException {
- if (uri == null) {
- throw new OseeArgumentException("URI was null.");
- }
- this.uri = uri;
- }
-
- public URI getLocation() {
- return uri;
- }
-
- public String getProtocol() {
- return uri.getScheme();
- }
-
- @Override
- public String toString() {
- return uri.toString();
- }
-
- @Override
- public String getRawPath() {
- String toReturn = uri.getSchemeSpecificPart();
- if (toReturn.startsWith("//") != false) {
- toReturn = toReturn.substring(2, toReturn.length());
- }
- return toReturn;
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.framework.resource.management.util;
+
+import java.net.URI;
+import org.eclipse.osee.framework.core.exception.OseeArgumentException;
+import org.eclipse.osee.framework.core.exception.OseeCoreException;
+import org.eclipse.osee.framework.resource.management.IResourceLocator;
+
+/**
+ * @author Roberto E. Escobar
+ */
+public class ResourceLocator implements IResourceLocator {
+
+ private final URI uri;
+
+ public ResourceLocator(URI uri) throws OseeCoreException {
+ if (uri == null) {
+ throw new OseeArgumentException("URI was null.");
+ }
+ this.uri = uri;
+ }
+
+ public URI getLocation() {
+ return uri;
+ }
+
+ public String getProtocol() {
+ return uri.getScheme();
+ }
+
+ @Override
+ public String toString() {
+ return uri.toString();
+ }
+
+ @Override
+ public String getRawPath() {
+ String toReturn = uri.getSchemeSpecificPart();
+ if (toReturn.startsWith("//") != false) {
+ toReturn = toReturn.substring(2, toReturn.length());
+ }
+ return toReturn;
+ }
+}
diff --git a/plugins/org.eclipse.osee.framework.resource.management/src/org/eclipse/osee/framework/resource/management/util/Resources.java b/plugins/org.eclipse.osee.framework.resource.management/src/org/eclipse/osee/framework/resource/management/util/Resources.java
index d60666f478..87f0ea521c 100644
--- a/plugins/org.eclipse.osee.framework.resource.management/src/org/eclipse/osee/framework/resource/management/util/Resources.java
+++ b/plugins/org.eclipse.osee.framework.resource.management/src/org/eclipse/osee/framework/resource/management/util/Resources.java
@@ -1,81 +1,81 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2007 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.framework.resource.management.util;
-
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.net.URLEncoder;
-import org.eclipse.osee.framework.core.exception.OseeCoreException;
-import org.eclipse.osee.framework.core.exception.OseeExceptions;
-import org.eclipse.osee.framework.jdk.core.util.Lib;
-import org.eclipse.osee.framework.resource.management.IResource;
-import org.eclipse.osee.framework.resource.management.internal.CompressedResourceBridge;
-
-/**
- * @author Roberto E. Escobar
- */
-public class Resources {
-
- private static String removeName(String path) {
- int index = path.lastIndexOf("/");
- if (index != -1) {
- path = path.substring(0, index + 1);
- }
- return path;
- }
-
- public static IResource compressResource(IResource resource) throws OseeCoreException {
- InputStream inputStream = null;
- byte[] buffer = new byte[0];
- try {
- inputStream = resource.getContent();
- buffer = Lib.compressStream(inputStream, resource.getName());
- } catch (IOException ex) {
- OseeExceptions.wrapAndThrow(ex);
- } finally {
- Lib.close(inputStream);
- }
- return createResourceFromBytes(buffer, resource.getLocation() + ".zip", true);
- }
-
- public static IResource decompressResource(IResource resource) throws OseeCoreException {
- String path = resource.getLocation().toASCIIString();
- ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
- String fileName = null;
- try {
- fileName = Lib.decompressStream(resource.getContent(), outputStream);
- fileName = URLEncoder.encode(fileName, "UTF-8");
- } catch (IOException ex) {
- OseeExceptions.wrapAndThrow(ex);
- } finally {
- Lib.close(outputStream);
- }
- if (fileName != null && fileName.length() > 0) {
- path = removeName(path) + fileName;
- } else {
- path = Lib.removeExtension(path);
- }
- return createResourceFromBytes(outputStream.toByteArray(), path, false);
- }
-
- public static IResource createResourceFromBytes(byte[] bytes, String path, boolean isCompressed) throws OseeCoreException {
- IResource resource = null;
- try {
- resource = new CompressedResourceBridge(bytes, new URI(path), isCompressed);
- } catch (URISyntaxException ex) {
- OseeExceptions.wrapAndThrow(ex);
- }
- return resource;
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.framework.resource.management.util;
+
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.net.URLEncoder;
+import org.eclipse.osee.framework.core.exception.OseeCoreException;
+import org.eclipse.osee.framework.core.exception.OseeExceptions;
+import org.eclipse.osee.framework.jdk.core.util.Lib;
+import org.eclipse.osee.framework.resource.management.IResource;
+import org.eclipse.osee.framework.resource.management.internal.CompressedResourceBridge;
+
+/**
+ * @author Roberto E. Escobar
+ */
+public class Resources {
+
+ private static String removeName(String path) {
+ int index = path.lastIndexOf("/");
+ if (index != -1) {
+ path = path.substring(0, index + 1);
+ }
+ return path;
+ }
+
+ public static IResource compressResource(IResource resource) throws OseeCoreException {
+ InputStream inputStream = null;
+ byte[] buffer = new byte[0];
+ try {
+ inputStream = resource.getContent();
+ buffer = Lib.compressStream(inputStream, resource.getName());
+ } catch (IOException ex) {
+ OseeExceptions.wrapAndThrow(ex);
+ } finally {
+ Lib.close(inputStream);
+ }
+ return createResourceFromBytes(buffer, resource.getLocation() + ".zip", true);
+ }
+
+ public static IResource decompressResource(IResource resource) throws OseeCoreException {
+ String path = resource.getLocation().toASCIIString();
+ ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
+ String fileName = null;
+ try {
+ fileName = Lib.decompressStream(resource.getContent(), outputStream);
+ fileName = URLEncoder.encode(fileName, "UTF-8");
+ } catch (IOException ex) {
+ OseeExceptions.wrapAndThrow(ex);
+ } finally {
+ Lib.close(outputStream);
+ }
+ if (fileName != null && fileName.length() > 0) {
+ path = removeName(path) + fileName;
+ } else {
+ path = Lib.removeExtension(path);
+ }
+ return createResourceFromBytes(outputStream.toByteArray(), path, false);
+ }
+
+ public static IResource createResourceFromBytes(byte[] bytes, String path, boolean isCompressed) throws OseeCoreException {
+ IResource resource = null;
+ try {
+ resource = new CompressedResourceBridge(bytes, new URI(path), isCompressed);
+ } catch (URISyntaxException ex) {
+ OseeExceptions.wrapAndThrow(ex);
+ }
+ return resource;
+ }
+}

Back to the top