package eu.ydp.empiria.player.client.util;

import com.google.gwt.core.client.GWT;
import com.google.gwt.http.client.URL;

public class PathUtil {

	public static String resolvePath(String path, String base){
		if( GWT.getHostPageBaseURL().startsWith("file://") ){

			String localURL = URL.decode( GWT.getHostPageBaseURL() );
			return localURL + path;
			
		} else if (path.contains("://")  ||  path.startsWith("/")){
			
			return path;
			
		} else {
			return base + path;
		}
		
	}
}

@@ -43,90 +43,8 @@
 %0D%0A%0D%0A
-import com.google.gwt.core.client.GWT;%0D%0Aimport com.google.gwt.http.client.URL;%0D%0A%0D%0A
 publ
@@ -134,169 +134,8 @@
 %0D%0A%09%09
-if( GWT.getHostPageBaseURL().startsWith(%22file://%22) )%7B%0D%0A%0D%0A%09%09%09String localURL = URL.decode( GWT.getHostPageBaseURL() );%0D%0A%09%09%09return localURL + path;%0D%0A%09%09%09%0D%0A%09%09%7D else 
 if (
@@ -184,21 +184,16 @@
 %22/%22))%7B%0D%0A
-%09%09%09%0D%0A
 %09%09%09retur
@@ -199,18 +199,16 @@
 rn path;
-%0D%0A
 %09%09%09%0D%0A%09%09%7D

fix path resolution bug