03-21-2012 11:45 AM
FileConnection fconn = (FileConnection)Connector.open(webAppLocation + relativeLocation);
However, I am unable to find in documentation what is the base URL to where the embedded web application is deployed. Can someone help me by providing the secret sauce?
03-23-2012 11:05 AM
I still have not found anything in the WebWorks documentation regarding this, but I found a nugget in a forum post that I'm going to try...
03-23-2012 04:54 PM
Tim Neil's stuff is solid gold of course.
Another hint is to compile with the -s option which will create a full dump of everything that's going into the BAR/COD file. Then you can see the exact path to where things are in your app.
03-26-2012 12:11 PM
No luck with compiling with the -s (or -v) options. The output does not reference the HTML/CSS/JS or image resources in the ZIP file.
What URL does WebWorks use to load my start page...index.html in the root of my zip file? If I want to make a Connection to that file, what do I use as the URL in my Connector.open() statement?
Which type of connection will this create? FileConnection, HTTPConnection, ContentConnection, something else?
Specifically, I'm trying to access a file called /resources/logo.png from the root of my zip.
This seems like it should be easy to do on the surface.
03-26-2012 01:00 PM
Also, FileConnections will only let you access the actual file system, not the resources within the COD file. You'll need to use the Class.getResourceAsStream() method, which returns an InputStream.
However, if you access a file through your HTML, you should be able to reference it by something like "/extension/test/img/logo.png".