In my tests I see that when I add a key component that contains a slash character "/", Oracle NoSQL encodes it as "%2F".
ArrayList<String> majorComponents = new ArrayList<String>(); majorComponents.add("forums.oracle.com/community"); Key myKey = Key.createKey(majorComponents); System.out.println(myKey.toString());
I tried to URLDecode.decode the string before I add it to the majorComponents but it doesn't work.
Therefore, my question is if there is a way to have a key that contains slash characters. Please have in mind that I would prefer not to split the string into multiple components every time a slash character occurs in the string.
Thank you very much in advance,
All Unicode characters are allowed in a key component, including slashes. Your code to create the key is correct, and the key component does contain a slash. The slash is escaped by the Key.toString method for two reasons: 1) to delineate key components, 2) to provide a URI syntax. If you call Key.getMajorPath and look at the component, you'll see the un-escaped slash. The Key.toString javadoc contains complete documentation of the string format.