Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRyan D. Brooks2015-12-23 12:02:39 -0500
committerRyan D. Brooks2015-12-23 12:02:39 -0500
commit491e33655af14eb3e0e19c3e68bfb4377eb26efa (patch)
tree1151508caa0c1aead471124941155914a8b57924 /plugins/org.eclipse.osee.framework.resource.management/src
parent707b3e7a293e5fab698327ccaa6fd9d3c0a1965d (diff)
downloadorg.eclipse.osee-491e33655af14eb3e0e19c3e68bfb4377eb26efa.tar.gz
org.eclipse.osee-491e33655af14eb3e0e19c3e68bfb4377eb26efa.tar.xz
org.eclipse.osee-491e33655af14eb3e0e19c3e68bfb4377eb26efa.zip
refactor: Use OseeCoreException.wrap were applicable
Diffstat (limited to 'plugins/org.eclipse.osee.framework.resource.management/src')
-rw-r--r--plugins/org.eclipse.osee.framework.resource.management/src/org/eclipse/osee/framework/resource/management/util/Resource.java7
-rw-r--r--plugins/org.eclipse.osee.framework.resource.management/src/org/eclipse/osee/framework/resource/management/util/Resources.java11
2 files changed, 6 insertions, 12 deletions
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 a2f61c9427..9c79edaba2 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
@@ -14,7 +14,6 @@ import java.io.BufferedInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.URI;
-import org.eclipse.osee.framework.core.exception.OseeExceptions;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.resource.management.IResource;
@@ -32,13 +31,11 @@ public class Resource implements IResource {
@Override
public InputStream getContent() throws OseeCoreException {
- InputStream stream = null;
try {
- stream = new BufferedInputStream(uri.toURL().openStream());
+ return new BufferedInputStream(uri.toURL().openStream());
} catch (IOException ex) {
- OseeExceptions.wrapAndThrow(ex);
+ throw OseeCoreException.wrap(ex);
}
- return stream;
}
@Override
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 0b2821f6ff..70723c142c 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
@@ -16,7 +16,6 @@ import java.io.InputStream;
import java.net.URI;
import java.net.URISyntaxException;
import java.net.URLEncoder;
-import org.eclipse.osee.framework.core.exception.OseeExceptions;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.jdk.core.util.Lib;
import org.eclipse.osee.framework.resource.management.IResource;
@@ -42,7 +41,7 @@ public class Resources {
inputStream = resource.getContent();
buffer = Lib.compressStream(inputStream, resource.getName());
} catch (IOException ex) {
- OseeExceptions.wrapAndThrow(ex);
+ OseeCoreException.wrapAndThrow(ex);
} finally {
Lib.close(inputStream);
}
@@ -60,7 +59,7 @@ public class Resources {
fileName = Lib.decompressStream(inputStream, outputStream);
fileName = URLEncoder.encode(fileName, "UTF-8");
} catch (IOException ex) {
- OseeExceptions.wrapAndThrow(ex);
+ OseeCoreException.wrapAndThrow(ex);
} finally {
Lib.close(inputStream);
Lib.close(outputStream);
@@ -74,12 +73,10 @@ public class Resources {
}
public static IResource createResourceFromBytes(byte[] bytes, String path, boolean isCompressed) throws OseeCoreException {
- IResource resource = null;
try {
- resource = new CompressedResourceBridge(bytes, new URI(path), isCompressed);
+ return new CompressedResourceBridge(bytes, new URI(path), isCompressed);
} catch (URISyntaxException ex) {
- OseeExceptions.wrapAndThrow(ex);
+ throw OseeCoreException.wrap(ex);
}
- return resource;
}
}

Back to the top