Dear All,

I have got my own application which manipulates resourceUri. In my
application there is a possiblity of having a url which ends with '/'.
Therefore, to set displayname in ContentImpl.java  :

         // set the display name (in case of copy)
        String resourceName = strUri;
        int lastSlash = resourceName.lastIndexOf('/');
        if (lastSlash != -1)
            resourceName = resourceName.substring(lastSlash + 1);
        revisionDescriptor.setName(resourceName);

displayname would set with empty String and couse a probelm.
Is in slide any possiblity that strUri in above code ends with '/' (for
example /files/test/ ). If so,  this part of code would make a problem
and behave as a bug. And maybe is better to be replace with:

        // set the display name (in case of copy)
        String resourceName = strUri;
+      if (resourceName.endsWith("/") )
+         resourceName  = resourceName.substring(0,
resourceName.length()-1);
        int lastSlash = resourceName.lastIndexOf('/');
        if (lastSlash != -1  )
            resourceName = resourceName.substring(lastSlash + 1);
        revisionDescriptor.setName(resourceName);

If I am wrong, please correct me.

Thanks Indeed,
Bita.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to