TheProjecter / sardine

Automatically exported from code.google.com/p/sardine
0 stars 0 forks source link

DavRessource.getName does not recognize folders #96

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
DavRessource.getName() on a folder gives you empty string

What is the expected output? What do you see instead?
it should give you the name of the folder

What version of the product are you using?
r234

Please provide any additional information below (including code examples
and full stack traces with line numbers in them).

You may want to change the method to something like this:

    public String getName()
    {
        String path = href.getPath();
        if(!this.isDirectory())
            return path.substring(path.lastIndexOf('/') + 1);
        else{
            path = path.substring(0,path.length()-1);
            return path.substring(path.lastIndexOf('/') + 1);
        }
    }

or is there a better solution?

Original issue reported on code.google.com by 5hp...@gmail.com on 24 May 2011 at 12:00

GoogleCodeExporter commented 9 years ago
In r237.

Original comment by dkocher@sudo.ch on 24 May 2011 at 1:37