Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

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.

  1. Create a collection called

...

  1. /c1/c2

...

  1. Code Block
    Collection collection = registry.newCollection();
    

...

  1. Call the

...

  1. put method.

    Code Block
    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.

Code Block
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.

Excerpt
hiddentrue
Instructions on how to add a resource to the Registry using API.