Configuring a file-backed HTTP resource for attribute filters

Brent Putman putmanb at georgetown.edu
Tue Jul 21 17:50:40 EDT 2015



On 7/21/15 5:43 PM, Brent Putman wrote:
>
>
> On 7/21/15 5:16 PM, Brent Putman wrote:
>>
>> The code in saveAndClone(...) starts off with this:
>>
>> FileOutputStream out = new FileOutputStream(backingResource.getFile());
>>
>> Have to see whether that's correct.  Possibly the file needs to be
>> explicitly created first. 
>
> No, I tested.  It doesn't have to exist, including intermediate
> directories.  They will be created as needed.

I did just notice however that since that line is outside the try block,
and the caller getInputStream() doesn't do anything with the caught
exception: if that line *does* throw, it's completely swallowed and
there is no logging or other output as to what happened.  So that may in
fact be what is making this so mysterious to diagnose...  FYI, that ctor
is specified to throw a FileNotFoundException under various conditions:

If the file exists but is a directory rather than a regular file, does
not exist but cannot be created, or cannot be opened for any other
reason then a <code>FileNotFoundException</code> is thrown.



So checking the perms here and/or trying a different location for the
backing file would be very helpful.



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://shibboleth.net/pipermail/users/attachments/20150721/ace7b856/attachment.html>


More information about the users mailing list