loading table of contents...

4.1.1. How To Access Arbitrary Resources

Question:

How can I access arbitrary resources?

Answer:

  1. Get the root folder of the repository:

  • FolderModel rootFolder=Editor.getEditor().getResourceFactory.getRootFolder();

  • This returns a FolderModel which can be used for further processing.

  1. Get the resource you are looking for:

  • ResourceModel myResource=rootFolder.pathLookup(new String []({"myFolderName", "myDocumentName"}));

    or

    ResourceModel myResource=rootFolder.pathLookup(new String("myFolderName/myDocumentName"));

  • This will return a ResourceModel of the searched resource or null if the resource does not exist.