I have a section of code that worked fine in 1.1.x and does not work in 2.x.x.
I keep getting the error:
com.sun.star.lang.IllegalArgumentException: URL seems to be an unsupported
one.
(I'd paste in code here, but it seems clear that this is a URL problem, and
not something else.)
I've been looking through the documentation. While there are examples of
using loadComponentFromURL, it is almost impossible to find an example of an
actual working URL to use as a parameter or how that URL is constructed from
a filename. I tried using a Java URL, creating it from a filename, and
getting the URL as a string, but I had to include java.net.URL and that
seemed to conflict with other imports (I'm still trying to figure that part
out).
With 1.x, when I had a filename, to convert it to a URL, I used this routine:
public String makeURL(String sFile) {
if (sFile.startsWith("private:factory/s")) {return sFile;}
if (!sFile.startsWith("/")) {sFile = "/" + sFile;}
if (sysConfig.getMode("osname").toLowerCase().indexOf("windows") >= 0) {
sFile = sFile.replace('\\', '/');
}
sFile = "file:" + sFile;
return sFile;
}
It worked without any problems before, but now it isn't working. I changed
the 3rd line so it would put "//" at the start of the line instead of "/" so
it would change from file:/ to file:// just in case, but no difference.
Seeing a few sample URLs would be a great help here.
Thanks!
Hal
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]