just a quick answer...
if you use the java.io.File object to locate the document
all you ahve to do is use the .toURL() function of that file Object and get an URL object which you in turn can just use the .toString() function from
for example on windows
File f = new File("c:\path\to\document.sxw"); f.toURL().toString();
which give you something like file://c|/path/to/document.sxw
on linux this code File f = new File("/home/user/path/to/document.sxw"); f.toURL().toString();
would give file:///home/user/path/to/document.sxw
If you want to pass "external" file URLs (e.g., those obtained from Java) into OOo, you should always pass them through the new com.sun.star.uri.ExternalUriReferenceTranslator service first, see <http://www.openoffice.org/servlets/ReadMsg?list=interface-announce&msgNo=595>.
-Stephan
/Christian
Ines Pfauch wrote:
On 15.02.2005, at 13:03, Joerg Barfurth wrote:
No. File URLs always start with "file://". But note that this is not simply a prefix. The rest of the URL must follow the URL rules for an absolute path: The path must start with a slash ('/'), path components are separated with a forward slash ('/') [even on windows you have to use this rather than a backslash] and many characters are considered special and have to be escaped.
Thus the windows path "C:\Documents And Settings\myname\my paper.sxw" becomes "file:///C:/Documents%20And%20Settings/myname/my%20paper.sxw". Possibly you can also use the optional 'host' part of a file URL to refer to files on the network. That is, the windows path "\\myserver\myshare\whatever" becomes "file://myserver/myshare/whatever".
Thanks a lot, that was what I have searched for :)
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
