Jody,

My apologies if I sound or have sounded agitated in this discussion. I do hope we find a solution.

Thanks for the analysis I believe we are now working on the same problem: clarifying api design
Yes, I share your goal but we don't seem to find a way to agree? I have done a proposal for a possible compromise, but afterwards I found another problem (the Paths class). If you read the entire javadoc at the top, you must agree something doesn't make sense there.

org.geosever.platform.resource.Files and org.geoserver.platform.resource.Paths are not strictly a ResourceStore utility class. These classes helped the GeoServer codebase adjust to having ResourceStore be such a strict API.

org.geoserver.platform.resource.Files is indeed about handling Files. That would have been the right place to put OS & file system related stuff. Not Paths, the original javadoc (everything apart from the sentence you added) clearly states that this is resourcestore path utility class, and that relative paths are not supported (by the resource store that is).

Your sentence about operating systems and absolute paths on the file system seems entirely out of place there.

Files and Paths utility classes work with absolute paths (because our code base does). ResourceStore does not, and I believe we should take steps to remove the test case that assumes it is willing to.

I agree about removing the test case, but I feel you are still missing the point.

Relative/absolute have different meaning when you are talking about resource store versus file system, because they have a different root. As said, the resource store in fact *only* supports absolute paths, absolute for its own root that is. Windows paths have nothing to do with it. The resource store API should be considered as entirely separate from the file system, that is just one implementation.

Perhaps the confusion is over the "path" that is used to retrieve resources from the resource store versus the "path" that the file system resource store specifically uses to access the files behind the resources.

And take steps to provide a warning if an linux absolute path is used (and the ResourceStore will assume that such a path is intended to be relative to the data directory). I have found several cases where such paths were used (notably in the rest Resource Controller) which have been addressed.

But how so? The resource controller is for the resource store, it should not have access to the file system? That would be a security issue too.

I think what probably should have happened, is that was made sure the file system resource store specifically never uses absolute files, only files relative to the data directory (but again, just one implementation).

Warning instead of an exception is perhaps a good idea. But which classes / methods do you suggest would provide this warning?

Kind Regards

Niels






_______________________________________________
Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

Reply via email to