@@ -0,0 +1,2252 @@
+package de.mycrobase.ssim.ed.helper;%0A%0Aimport java.io.ByteArrayInputStream;%0Aimport java.io.InputStream;%0Aimport java.io.UnsupportedEncodingException;%0Aimport java.util.HashMap;%0A%0Aimport com.jme3.asset.AssetInfo;%0Aimport com.jme3.asset.AssetKey;%0Aimport com.jme3.asset.AssetLoadException;%0Aimport com.jme3.asset.AssetLocator;%0Aimport com.jme3.asset.AssetManager;%0A%0A/**%0A * Use this special AssetLocator when you need to serve assets from%0A * memory/strings e.g. for test cases.%0A * %0A * @author cn%0A */%0Apublic class InMemoryLocator implements AssetLocator %7B%0A    %0A    private static HashMap%3CString, String%3E files = new HashMap%3CString, String%3E();%0A    %0A    private String rootPath = %22%22;%0A    %0A    public InMemoryLocator() %7B%0A    %7D%0A    %0A    @Override%0A    public void setRootPath(String rootPath) %7B%0A        this.rootPath = rootPath;%0A        if(rootPath.equals(%22/%22)) %7B%0A            rootPath = %22%22;%0A        %7D else if(rootPath.length() %3E 1)%7B%0A            if(rootPath.startsWith(%22/%22))%7B%0A                rootPath = rootPath.substring(1);%0A            %7D%0A            if(!rootPath.endsWith(%22/%22)) %7B%0A                rootPath += %22/%22;%0A            %7D%0A        %7D%0A    %7D%0A    %0A    @Override%0A    public AssetInfo locate(AssetManager manager, AssetKey key) %7B%0A        String path = key.getName();%0A        if(path.startsWith(%22/%22)) %7B%0A            path = path.substring(1);%0A        %7D%0A        path = rootPath + path;%0A        if(!files.containsKey(path)) %7B%0A            return null;%0A        %7D%0A        return new InMemoryAssetInfo(manager, key, files.get(path));%0A    %7D%0A    %0A    public static void registerFile(String path, String content) %7B%0A        files.put(path, content);%0A    %7D%0A    %0A    private static class InMemoryAssetInfo extends AssetInfo %7B%0A        %0A        private String content;%0A        %0A        public InMemoryAssetInfo(AssetManager manager, AssetKey key, String content) %7B%0A            super(manager, key);%0A            this.content = content;%0A        %7D%0A        %0A        @Override%0A        public InputStream openStream() %7B%0A            try %7B%0A                return new ByteArrayInputStream(content.getBytes(%22UTF-8%22));%0A            %7D catch(UnsupportedEncodingException ex) %7B%0A                throw new AssetLoadException(%22Failed to convert asset content to UTF-8%22, ex);%0A            %7D%0A        %7D%0A    %7D%0A%7D%0A

Add InMemoryLocator for jME asset locating