summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2013-06-09 06:00:47 +0200
committerSven Gothel <[email protected]>2013-06-09 06:00:47 +0200
commit377d9de1ff1e2fabcd9bb7f65c0318f3c890392c (patch)
tree92e566dd7e47546dce96eeb8804b77337b77e796 /src
parent83cc11676314488ca0669366933e807e8fdead87 (diff)
Fix Bug 683 part1b: Add IOUtil.getRelativeOf(URL, ..), wrapper for URI for convenience (JOGL ShaderCode) and bwd. compatibility
Diffstat (limited to 'src')
-rw-r--r--src/java/com/jogamp/common/util/IOUtil.java12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/java/com/jogamp/common/util/IOUtil.java b/src/java/com/jogamp/common/util/IOUtil.java
index d2b97a0..46d6b24 100644
--- a/src/java/com/jogamp/common/util/IOUtil.java
+++ b/src/java/com/jogamp/common/util/IOUtil.java
@@ -592,6 +592,18 @@ public class IOUtil {
}
/**
+ * Wraps {@link #getRelativeOf(URI, String)} for convenience.
+ * @throws IOException
+ */
+ public static URL getRelativeOf(URL baseURL, String relativePath) throws IOException {
+ try {
+ return getRelativeOf(baseURL.toURI(), relativePath).toURL();
+ } catch (URISyntaxException e) {
+ throw new IOException(e);
+ }
+ }
+
+ /**
* Generates a URI for the <i>relativePath</i> relative to the <i>schemeSpecificPart</i>,
* hence the result is a absolute location.
* <p>