From f7fdabf9a8cee03a283b46e07e3a48081a64b856 Mon Sep 17 00:00:00 2001 From: "nor..67" Date: Sun, 6 Nov 2011 01:02:47 +0000 Subject: [PATCH] - Change getRelativeAssetPath method to strip only slashes (Fixes issue 412) git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@8580 75d07b2b-3a1a-0410-a2c5-0572b91ccdca --- .../com/jme3/gde/core/assets/ProjectAssetManager.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/sdk/jme3-core/src/com/jme3/gde/core/assets/ProjectAssetManager.java b/sdk/jme3-core/src/com/jme3/gde/core/assets/ProjectAssetManager.java index 13f7c3268..8350de9d5 100644 --- a/sdk/jme3-core/src/com/jme3/gde/core/assets/ProjectAssetManager.java +++ b/sdk/jme3-core/src/com/jme3/gde/core/assets/ProjectAssetManager.java @@ -104,12 +104,18 @@ public class ProjectAssetManager extends DesktopAssetManager { String prefix = getAssetFolderName(); int idx = absolutePath.indexOf(prefix); if (idx == 0) { - System.out.println("absolute/prefix:"+absolutePath+" / "+prefix); - return absolutePath.substring(prefix.length() + 1); + return stripFirstSlash(absolutePath.substring(prefix.length())); } return absolutePath; } + private String stripFirstSlash(String input) { + if (input.startsWith("/")) { + return input.substring(1); + } + return input; + } + @Deprecated public AssetManager getManager() { return this;