On 10/29/09 13:14, Steffen Boersig wrote:
If I'm changing the code to//fileURL = E:\Test.ods String fileURL = file.getAbsolutePath(); URL = file:/// + fileURL; try { PropertyValue[] loadProperties = new PropertyValue[1];loadProperties[0] = new PropertyValue("ReadOnly", 0, new Boolean(false), PropertyState.DIRECT_VALUE);aBean.loadFromURL(URL, loadProperties);the document will be loaded as well. That's some nice feature of the loadFromURL() function to not enforce converting backslashes. BUT it is then opened in read only mode. Which in my opinion is strange and not intuitive for users of the api.
<file:///E:\Test.ods> is not a valid URL to denote Windows pathname E:\Test.ods (<file:///E:/Test.ods> would be correct). I vaguely remember that the implementation of loadComponentFromURL indeed does somewhat strange things upon such invalid input (which would explain the read-only status; maybe there is already an issue for this?).
(By the way, <E:/Test.ods> is also not a valid URL to denote Windows pathname E:\Test.ods; it is an URL of the---unknown---schema "e". That loadFromURL happens to work "as expected" for such invalid input is a sad consequence of "try to guess what the client wants" software.)
-Stephan --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
