When you to take the path of a resource, it isn't possible to derive 
from the path whether it is absolute or relative in Linux (Resource 
paths according to the specs do not support relative paths and make no 
difference between a starting slash and no starting slash).

I don't think this would be dangerous or affect anything. 
ResourceWrappers are used to provide simple files to objects and methods 
that expect a Resource. They should be threaten like a normal resource, 
and are mostly used to directly read and write to it.

Returning a relative file path from a resource provides incomplete, 
nonsensical information to somebody who just wants to use the resource API.

This change simply guarantees that the path returned is unique and makes 
some kind of consistent sense to somebody who is following the resource API.

Regards
Niels

On 21-04-16 00:26, Ben Caradoc-Davies wrote:
> Jody, it is not essential to get this into 2.9-beta2. If it is not 
> included, then please change the Fix Version of GEOS-7493 to 2.9-RC1.
>
> I considered the impact of the change you noted below, and also 
> whether it should be getCanonicalFile (and I thought not). As far as I 
> know, there is no new requirement for the file to exist, and this 
> change did not break any resource theory tests. How do you think it 
> changes the capability of the class? It is a change that caught my 
> attention too. Thanks for your eagle-eyed scrutiny!
>
> I could speculate why this change was made but I would rather let 
> Niels answer for himself. Niels?
>
> Kind regards,
> Ben.
>
>
> On 21/04/16 10:10, Jody Garnett wrote:
>> I just started the release builds.
>>
>> I had a comment on 1565 on this change to ResourceAdapter:
>>
>>           private ResourceAdaptor(File file) {
>> -            this.file = file;
>> +           this.file = file.getAbsoluteFile();
>>               ...
>>
>> I wanted to make sure that this change was on purpose, since it 
>> changes the
>> capability of the class in some respect.
>>
>> -- 
>> Jody Garnett
>>
>> On 20 April 2016 at 14:54, Ben Caradoc-Davies <[email protected]> wrote:
>>
>>> I am sneaking in a small low-risk Resources bugfix from Niels 
>>> (merged on
>>> master):
>>>
>>> GEOS-7493 Path.names not removing root slash
>>> https://github.com/geoserver/geoserver/pull/1565
>>> https://osgeo-org.atlassian.net/browse/GEOS-7493
>>>
>>> Kind regards,
>>>
>>> -- 
>>> Ben Caradoc-Davies <[email protected]>
>>> Director
>>> Transient Software Limited <http://transient.nz/>
>>> New Zealand
>>>
>>
>


------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
_______________________________________________
Geoserver-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

Reply via email to