From 7927ad4bbf05323f432b8f5b6c4e9e0dd1b26042 Mon Sep 17 00:00:00 2001 From: "nor..67" Date: Sat, 19 Nov 2011 09:38:09 +0000 Subject: [PATCH] - add SDK workaround for UrlLocator git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@8722 75d07b2b-3a1a-0410-a2c5-0572b91ccdca --- .../src/desktop/com/jme3/asset/plugins/UrlLocator.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/engine/src/desktop/com/jme3/asset/plugins/UrlLocator.java b/engine/src/desktop/com/jme3/asset/plugins/UrlLocator.java index 691fa2b32..bb54d598c 100644 --- a/engine/src/desktop/com/jme3/asset/plugins/UrlLocator.java +++ b/engine/src/desktop/com/jme3/asset/plugins/UrlLocator.java @@ -33,12 +33,9 @@ package com.jme3.asset.plugins; import com.jme3.asset.*; -import java.io.FileNotFoundException; import java.io.IOException; -import java.io.InputStream; import java.net.MalformedURLException; import java.net.URL; -import java.net.URLConnection; import java.util.logging.Level; import java.util.logging.Logger; @@ -64,7 +61,12 @@ public class UrlLocator implements AssetLocator { public AssetInfo locate(AssetManager manager, AssetKey key) { String name = key.getName(); try{ - URL url = new URL(root, name); + //TODO: remove workaround for SDK +// URL url = new URL(root, name); + if(name.startsWith("/")){ + name = name.substring(1); + } + URL url = new URL(root.toExternalForm() + name); return UrlAssetInfo.create(manager, key, url); }catch (IOException ex){ logger.log(Level.WARNING, "Error while locating " + name, ex);