You are viewing a plain text version of this content. The canonical link for it is here.
Posted to slide-dev@jakarta.apache.org by Dror Harari <dr...@attunity.co.il> on 2001/07/08 18:03:26 UTC

Problems in FileDescriptorsStoreNoVersioning

1. In 'public ObjectNode retrieveObject(Uri uri)' around line 224

old:      File file = new File(rootpath+ relative + ".structure");

new:     File file = new File(new File(rootpath), relative + ".structure");

The reason being that proper file path concatenation cannot be done with
'+'. For example, I got rootpath='files', relative='users' and the result
was file=filesusers.structure

2. Same place around line 260

old            File file = new File(rootpath+uri.getRelative());

new:             File file = new File(new File(rootpath),
uri.getRelative());

3. Same place around line 243

        } catch (FileNotFoundException e) {
            //e.printStackTrace();
            // Silent exception, except if we're on the root path
            if (relative.equals("/"))
                throw new ObjectNotFoundException(uri);

The silent ignore of the exception (which is not done in the case in the
memory descriptors store) causes the following exception:

08 Jul 2001 18:38:37 - INFO - Loading namespace xml configuration
java.lang.ClassCastException: org.apache.slide.structure.SubjectNode
        at
org.apache.slide.common.NamespaceConfig.getActionNode(NamespaceConfig.java:1
030)
        at
org.apache.slide.common.NamespaceConfig.initializeNamespaceConfig(NamespaceC
onfig.java:589)
        at
org.apache.slide.common.Namespace.loadConfiguration(Namespace.java:745)
        at org.apache.slide.common.Domain.initNamespace(Domain.java:699)
        at org.apache.slide.common.Domain.init(Domain.java:361)
        at org.apache.slide.common.Domain.selfInit(Domain.java:633)
        at org.apache.slide.common.Domain.accessNamespace(Domain.java:185)
        at xml.Test.main(Test.java:71)

Because we do not return ObjectNotFoundException, the /actions is created as
SubjectNode and then when we try to use it we get a cast error because we
try to cast it as ActionNode....

/d


Re: Problems in FileDescriptorsStoreNoVersioning

Posted by Remy Maucherat <re...@apache.org>.
> 1. In 'public ObjectNode retrieveObject(Uri uri)' around line 224
>
> old:      File file = new File(rootpath+ relative + ".structure");
>
> new:     File file = new File(new File(rootpath), relative +
".structure");
>
> The reason being that proper file path concatenation cannot be done with
> '+'. For example, I got rootpath='files', relative='users' and the result
> was file=filesusers.structure
>
> 2. Same place around line 260
>
> old            File file = new File(rootpath+uri.getRelative());
>
> new:             File file = new File(new File(rootpath),
> uri.getRelative());
>
> 3. Same place around line 243

Yes indeed.

It would be a good idea to use this store (when it's done, of course) as the
default store. Unfortunately, I don't have a lot of time to dedicate to it,
so feel free to volunteer to work on it.
If I remember well, the code was very preliminary, and I didn't like the
design that much. So if you don't like it either, you can also dump the
current code and start it again from scratch.

Also, it was proposed some time ago that the .structure and the other
metadata files would contain XML data.

Remy