Why would you want to move a directory inside itself?

If you do this with a jdbcresourcestore, you will get resources in the database that are unreachable from the root, i.e. do not have an actual path any longer, and furthermore, a cyclic relationship that can cause an endless recursive loop if you scan through the moved directory recursively.

I do not see how it could be different with a file system. Would it not only cause inconsistencies?Or what is the expected end result? So why would you want to permit it? Why is it not a good thing to prevent this, what goal does it accomplish?

Regards
Niels

On 09/09/2016 07:07 PM, Torben Barsballe wrote:
When fixing GEOS-7651 <https://osgeo-org.atlassian.net/browse/GEOS-7651>, I made some changes to how resource move/rename works so that it actually functions properly on windows.

This has caused a test failure over in gs-restconfig. I have tracked this failure down to here:

https://github.com/geoserver/geoserver/blob/master/src/restconfig/src/test/java/org/geoserver/rest/resources/ResourceTest.java#L298

As far as I can determine, the test expects this line to fail, as it is moving a directory resource inside itself, which fails when using a standard java rename.

The new implementation of rename uses the Apache commons file utils, which is fully capable of moving a directory inside itself.

Am I save to delete this one line, so that the test just does the one, 'proper' rename, or is there some other reason why moving a directory resource inside itself should fail (In which case, I can modify rename to explicitly check for this)?

Thanks,

Torben

------------------------------------------------------------------------------
_______________________________________________
Geoserver-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

Reply via email to