- add SDK workaround for UrlLocator

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@8722 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
3.0
nor..67 13 years ago
parent 7330f8cff9
commit 7927ad4bbf
  1. 10
      engine/src/desktop/com/jme3/asset/plugins/UrlLocator.java

@ -33,12 +33,9 @@
package com.jme3.asset.plugins; package com.jme3.asset.plugins;
import com.jme3.asset.*; import com.jme3.asset.*;
import java.io.FileNotFoundException;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream;
import java.net.MalformedURLException; import java.net.MalformedURLException;
import java.net.URL; import java.net.URL;
import java.net.URLConnection;
import java.util.logging.Level; import java.util.logging.Level;
import java.util.logging.Logger; import java.util.logging.Logger;
@ -64,7 +61,12 @@ public class UrlLocator implements AssetLocator {
public AssetInfo locate(AssetManager manager, AssetKey key) { public AssetInfo locate(AssetManager manager, AssetKey key) {
String name = key.getName(); String name = key.getName();
try{ 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); return UrlAssetInfo.create(manager, key, url);
}catch (IOException ex){ }catch (IOException ex){
logger.log(Level.WARNING, "Error while locating " + name, ex); logger.log(Level.WARNING, "Error while locating " + name, ex);

Loading…
Cancel
Save