This documentation is for WSO2 Application Server 5.2.0. View documentation for the latest release.
Adding a Resource with API - Application Server 5.2.0 - WSO2 Documentation
||
Skip to end of metadata
Go to start of metadata

Add a resource to the registry instance

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);
    

Access the created resource

If you call the get method, then you will be able to access that created resource.

Add a resource with content

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);

Adding a Resource - For information on adding a resource using the Management Console.

  • No labels