This site contains the documentation that is relevant to older WSO2 product versions and offerings.
For the latest WSO2 documentation, visit https://wso2.com/documentation/.

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Next »

To add a resource to the registry instance, create a Resource object and then pass the created resource object to the registry instance's  put method:

  1. Create a collection called "/c1/c2."

    Collection collection = registry.newCollection();
  2. Call the put method.

    registry.put("/c1/c2", collection);

If you call the get method, then you will be able to access that created resource. You can also use the set method to set the value of the resource. For example:

//set property
registry.setProperty("propertyName", "value")

//get property
registry.getProperty("propertyName");

To add a resource with content, create a Resource object and then set content.

Resource r1 = registry.newResource();
String str = "My File Content";
r1.setContent(str.getBytes());
registry.put("/c1/c2/r1", r1);

See also Adding a Resource to learn how to do it using the Management Console.

  • No labels