[Yanel-dev] yarep patch to support splitting of paths

Claudio Corrodi claudio.corrodi at wyona.com
Mon Jul 19 10:09:34 CEST 2010


I added the feature that when trying to read a file that doesn't exist =

at the splitted destination but if it exists at the "original" =

destination, then the file is copied to the splitted path. Let me make =

an example:

In the filesystem, there is a file /data/foobar.txt and /data/ is the
repository root. Let's also assume that the repository is configured =

such that /foobar.txt results in reading/writing the file =

/data/foo/bar.txt. If /data/foo/bar.txt doesn't exist, but =

/data/foobar.txt does, then this update falls back to /data/foobar.txt =

after failing to get a stream for /data/foo/bar.txt. It then copies =

/data/foobar.txt to /data/foo/bar.txt and continues using the new =

(splitted) path.

Note that the old file isn't removed after copying, maybe we want to add
this functionality later.

Regards,
Claudio

On 07/16/2010 10:58 AM, Claudio Corrodi wrote:
> Hi
>
> Attached is a patch which allows to configure a
> VirtualFileSystemRepository to split paths automatically according to
> various parameters. A use case would be for example if you need to store
> a lot of files under a certain path, e.g. /data/ and want them in
> multiple subdirectories. Then this patch allows you to define rules such
> that paths like /data/76f76641-c80d-4cd7-9470-c47eeae48bbc are actually
> stored at /data/76f7/7664/-c80d-4cd7-9470-c47eeae48bbc.
>
> Please take a look at src/test/repository/new-vfs-example/repository.xml
> for a description and example configuration. I also updated the
> VirtualFilesystemRevisionTest which can be run using "./build.sh test
> -Dtest.class.name=3Dorg.wyona.yarep.tests.VirtualFilesystemRevisionsTest".
>
> Regards,
> Claudio
>

-------------- next part --------------
A non-text attachment was scrubbed...
Name: splitpath.patch
Type: text/x-patch
Size: 15248 bytes
Desc: not available
Url : http://lists.wyona.org/pipermail/yanel-development/attachments/201007=
19/1decb25a/splitpath.bin


More information about the Yanel-development mailing list