On Mon, Jun 15, 2015 at 6:01 PM, vincent(a)massol.net <vincent(a)massol.net> wrote:
On 15 Jun 2015 at 16:32:28, vincent(a)massol.net
(vincent@massol.net(mailto:vincent@massol.net)) wrote:
On 15 Jun 2015 at 16:31:43, vincent(a)massol.net
(vincent@massol.net(mailto:vincent@massol.net)) wrote:
> Hi devs,
>
> I’m modifying code for handling NestedSpaces in URLs and a lot of code is doing
reference serialization "by hand”. I’d like to rationalize this.
>
> Proposal:
>
> * Deprecate the “path” resolver/serializer which is currently located in
platform-store-filesystem-attachment since “path” is misleading. It’s actually a FS Path
(since it uses File.separator).
> * Introduce a new “fspath” resolver/serializer (copy the “path” one) but put it in
the platform-model module since it should be able to be used by any module using the FS.
> * Introduce a new “file” serializer which will generate a file name out of a
reference. UC: when needing to store temporary files (for exports for example)
Better hint: “filename”
Thanks
-Vincent
> > ** use “.” as separator
> > ** escape the “.” using “%2E” as it’s done in the “path” serializer (
URLEncoder.encode(currentReference.getName(), "UTF-8").replace(".",
"%2E")); ) hoping that whoever wrote it checked that “%” was a valid char in all
File systems… ;)
As a readability improvement you might want to unescape " " and "-"
which are escaped by URLEncoder but don't need to be.
The “file” serializer would also be located in platform-model
Thanks
-Vincent
>
> WDYT?
>
> Thanks
> -Vincent
>
_______________________________________________
devs mailing list
devs(a)xwiki.org
http://lists.xwiki.org/mailman/listinfo/devs
--
Thomas Mortagne