Examples of OnDemandContentResourceImpl


Examples of org.wso2.carbon.registry.ws.client.resource.OnDemandContentResourceImpl

  public static Resource transformWSResourcetoResource(WSRegistryServiceClient client, WSResource wsResource, Object content)throws RegistryException {
    ResourceImpl resource = null;
    if (wsResource instanceof WSCollection) {
      resource = new OnDemandContentCollectionImpl(client);
    } else {
      resource = new OnDemandContentResourceImpl(client);
    }

    if (wsResource.getDescription() != null) resource.setDescription(wsResource.getDescription());
    if (wsResource.getMediaType() != null) resource.setMediaType(wsResource.getMediaType());
    if (wsResource.getProperties() != null) resource.setProperties(getPropertiesForResource(wsResource.getProperties(), resource.getProperties()));
View Full Code Here

Examples of org.wso2.carbon.registry.ws.client.resource.OnDemandContentResourceImpl

      String testPath = "ondemand/test";
          Resource r1 = registry.newResource();
          r1.setContent("This is test content. It should not be loaded unless getContent() is called.".getBytes());
          registry.put(testPath, r1);
         
          OnDemandContentResourceImpl r1_get = (OnDemandContentResourceImpl) registry.get(testPath);
          r1_get.setClient(null);
          Object content = null;
          try {
            content = r1_get.getContent();
            assertNull("Resource content should not exist",content);
            fail("Content has not been pre-fetched, not on demand");
          } catch (Exception e) {
            e.printStackTrace(); // printing stack trace for verification.
          }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.