how to change hebrew path into english in dropbox api(Java)

131 views Asked by At

I'm working with the dropbox api to java and i have trying to read from dropbox.

When I use the path of the api it looks like this -

טיול פסח path: /Public/טיול פסח 

(Ignore the hebrew words it's like - someFolderName paht: /Public/someFolderName)

and it's looks as usual, but when I try to go to this path it's give me this exception -

Exception in thread "main" java.lang.NullPointerException
    at node.Main.listFolders(Main.java:102)
    at node.Main.main(Main.java:112)

When I use the toString() method of the api that give some of the metaData including the path of the folder it's shows me this -

טיול פסח toString(): Folder("/Public/\u05d8\u05d9\u05d5\u05dc \u05e4\u05e1\u05d7"...)

When the string within the quotes should be the path. When I tried to enter this as the path it's give me this exception -

Exception in thread "main" java.lang.NullPointerException
    at node.Main.listFolders(Main.java:102)
    at node.Main.main(Main.java:112)

The code example:

The path is "/Public" and it's the argument s. client is the access to my dropbox. listing is list of children of the root folder.

public static void listFolders(String s) throws DbxException, IOException {
        //list of children. 
        DbxEntry.WithChildren listing = client.getMetadataWithChildren(s);

        for (DbxEntry child : listing.children) {
            System.out.println("    " + child.name + " toString(): " + child.toString());
            System.out.println("    " + child.name + " path: " + child.path);
        }

    }

The output of this with "/Public" as argument is:

טיול פסח toString(): Folder("/Public/\u05d8\u05d9\u05d5\u05dc \u05e4\u05e1\u05d7", iconName="folder", mightHaveThumbnail=false)
טיול פסח path: /Public/

Any thoughts?

0

There are 0 answers