I'm trying to add a CesiumResource from a local file to be embedded into the CZML file. When I generate the URI using a full URL this process works just fine but I have to have the server up and running at the time the script is run to make sure that the resource is available:
Billboard_res = new CesiumResource(new URI("http://localhost:8080/Apps/images/satellite1.png"),CesiumResourceBehavior.EMBED);
I would much rather have the file in the same directory as the java script and generate the URI from the relative path like this:
Billboard_res = new CesiumResource(new URI("file:///satellite1.png"),CesiumResourceBehavior.EMBED);
For some reason this doesn't work and I always get the error:
Exception in thread "main" java.lang.ClassCastException: sun.net.www.protocol.file.FileURLConnection cannot be cast to java.net.HttpURLConnection
Thank you for your help.