Christoph Lutz wrote:
> // Bug 1:
> // providing a non-empty MediaDescriptor throws an
> // IllegalArgumentException.
> try {
> insertProps = new PropertyValue[] { new PropertyValue() };
> insertProps[0].Name = "Author";
> insertProps[0].Value = "itsMe";
> xInsert.insertDocumentFromURL(
> "file:///W:/aFolder/thisFileDoesNotExist", insertProps);
> } catch (IllegalArgumentException e) {
> e.printStackTrace();
> }
This is not a bug, the argument "Author" it not allowed here, so the
exception is correct. "Author" is for saving versions only.
> System.out.println("test 2");
>
> // Bug ?:
> // trying to insert a document with a non-existing file-URL
> // does nothing (not even an exception)
> insertProps = new PropertyValue[] {};
> xInsert.insertDocumentFromURL(
> "file:///aFolder/thisFileDoesNotExist", insertProps);
You don't get an exception (IoException is expected) because no suitable
exception is allowed here. The API was designed wrongly, but it's
unfortunately not possible to change it because this would break
existing code. So it's a bug, but it can be fixed only by introducing an
additional interface.
> System.out.println("test 3");
>
> // Bug 2:
> // trying to insert a document with a non-existing file-URL
> // causes OOo to freeze IF the URL start with a drive letter "c:"
> insertProps = new PropertyValue[] {};
> xInsert.insertDocumentFromURL(
> "file:///c:/aFolder/aNonExistingFile", insertProps);
If it was reproducable it would be a bug.
> System.out.println("test 4");
>
> // trying to insert a document with a non-existing file-URL
> // causes OOo to freeze IF the URL is an unresolved http-url.
> insertProps = new PropertyValue[] {};
> xInsert.insertDocumentFromURL(
> "http://www.michgibtswirklichnichtglaubichauchnicht.de/index.odt",
> insertProps);
>
> System.out.println("finished!");
> System.exit(0);
Ditto. In both cases it's possible that the hanging office could be
caused by very long timeouts in the file system or http access. In this
case it's not a bug in OOo, it's just bad luck.
Best regards,
Mathias
--
Mathias Bauer - OpenOffice.org Application Framework Project Lead
Please reply to the list only, [EMAIL PROTECTED] is a spam sink.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]