Thanks Yegor that is exactly right, I didn't realize setAddress() was expecting 
strings from URI's.  After switching to URI the code performs outstandingly, 
just as I've come to expect from Apache projects.


Thanks again to Yegor & Nick

David

-----Original Message-----
From: Yegor Kozlov [mailto:[email protected]] 
Sent: Tuesday, January 31, 2012 4:57 AM
To: POI Users List
Subject: Re: XSSF & Hyperlink to Directory

Current implementation is too forgiving. The setAddress function
writes the raw string in the OPC relationship table and passing an
invalid value will corrupt the output file.

The setAddress function should accept strings that are valid URIs. If
you are passing a file then instead of passing File.getPath() pass
File.toURI().toString()

I'm going to improve it and add validation. If you pass a wrong string
then setAddress should throw IllegalArgumentException

Yegor

On Tue, Jan 31, 2012 at 2:28 AM, Cross, David A. <[email protected]> wrote:
> Thanks Nick,
>
> It hadn't occurred to me to unzip and read through the xml.  By doing so I 
> was able to find what was expected, and I can write a method that will 
> translate the file path into the appropriate URL like form such as 
> ("file:////network%20place/) and it works .  It is unfortunate that it will 
> not just accept a java file path but this will work for me and I like it 
> better than the excel function method
>
> Thanks again
> David
>
> -----Original Message-----
> From: Nick Burch [mailto:[email protected]]
> Sent: Monday, January 30, 2012 11:34 AM
> To: POI Users List
> Subject: RE: XSSF & Hyperlink to Directory
>
> On Mon, 30 Jan 2012, Cross, David A. wrote:
>> In Excel you can add a hyperlink to any cell and point it to any of the
>> example directories above
>
> Can you try unzipping the .xlsx files from POI and Excel, and seeing how
> they differ in their hyperlinks? If memory serves, they get stored as
> relations, but a grep (or similar) should let you find which file(s)
> they're in
>
> Nick
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to