Commands: How to get full url for a document?
urlFor
is a helper method that returns full url for a given document key.
Syntax
public String urlFor(String documentKey);
Parameters |
|
|
documentKey |
String |
Key of a document for which full url will be returned |
Return Value |
|
String |
Full url for a given document key |
Example I
// http://localhost:8080/databases/Northwind/docs/employees/1
String url = store.getDatabaseCommands().urlFor("employees/1");
Example II
// // http://localhost:8080/docs/employees/1
String url = store.getDatabaseCommands().forSystemDatabase().urlFor("employees/1");