Examples of ResourceData


Examples of org.pentaho.reporting.libraries.resourceloader.ResourceData

    if (baseKey != null)
    {
      try
      {
        final ResourceKey resourceKey = manager.deriveKey(baseKey, propsName);
        final ResourceData resource = manager.load(resourceKey);

        final InputStream instream = resource.getResourceAsStream(manager);
        try
        {
          final LibLoaderResourceBundle resourceBundle = new LibLoaderResourceBundle(instream);
          successfulLoads.put(propsName, resourceBundle);
          return resourceBundle;
        }
        finally
        {
          instream.close();
        }
      }
      catch (Exception e)
      {
        // silently ignore ..
      }
    }

    try
    {
      // try to load the bundle via classpath ...
      final ResourceKey resourceKey = manager.createKey("res://" + propsName); // NON-NLS
      final ResourceData resource = manager.load(resourceKey);

      final InputStream instream = resource.getResourceAsStream(manager);
      try
      {
        final LibLoaderResourceBundle resourceBundle = new LibLoaderResourceBundle(instream);
        successfulLoads.put(propsName, resourceBundle);
        return resourceBundle;
View Full Code Here

Examples of org.pentaho.reporting.libraries.resourceloader.ResourceData

      {
        instance = maybeImage;
      }
      else
      {
        final ResourceData data = resourceManager.load(resource);
        instance = com.lowagie.text.Image.getInstance(data.getResource(resourceManager));
        imageCache.put(resource, instance);
      }
      return instance;
    }
    catch (InvalidReportStateException re)
View Full Code Here

Examples of org.pentaho.reporting.libraries.resourceloader.ResourceData

    }

    try
    {
      final ResourceManager resourceManager = getResourceManager();
      final ResourceData resource = load();
      if (xpath.isLegacyQuery())
      {
        return new LegacyXPathTableModel(resource, resourceManager, xpath.getXpathExpression(), parameters, queryLimitVal);
      }
      return new XPathTableModel(resource, resourceManager, xpath.getXpathExpression(), parameters, queryLimitVal);
View Full Code Here

Examples of org.pentaho.reporting.libraries.resourceloader.ResourceData

  public InputStream getResourceAsStream(final ResourceManager caller) throws ResourceLoadingException
  {
    // again, this is going to hurt the performance.
    final ResourceKey parentKey = key.getParent();
    final ResourceData data = caller.load(parentKey);

    final ZipInputStream zin = new ZipInputStream(data.getResourceAsStream(caller));
    try
    {
      try
      {
        ZipEntry zipEntry = zin.getNextEntry();
View Full Code Here

Examples of org.pentaho.reporting.libraries.resourceloader.ResourceData

  public long getVersion(final ResourceManager caller)
          throws ResourceLoadingException
  {
    final ResourceKey parentKey = key.getParent();
    final ResourceData data = caller.load(parentKey);
    return data.getVersion(caller);
  }
View Full Code Here

Examples of org.pentaho.reporting.libraries.resourceloader.ResourceData

    if (contextKey != null)
    {
      try
      {
        final ResourceKey resourceKey = manager.deriveKey(contextKey, xmiFile);
        final ResourceData data = manager.load(resourceKey);
        return data.getResourceAsStream(manager);
      }
      catch (ResourceException re)
      {
        // ignore, lets go on to the direct parsing as a local file
      }
    }

    final ResourceKey resourceKey = manager.createKey(new File(xmiFile));
    final ResourceData data = manager.load(resourceKey);
    return data.getResourceAsStream(manager);
  }
View Full Code Here

Examples of org.pentaho.reporting.libraries.resourceloader.ResourceData

      final String pfbFileName = fontType.substring
          (0, fontType.length() - 4) + ".pfb";
      try
      {
        final ResourceKey pfbKey = manager.deriveKey(key, pfbFileName);
        final ResourceData res = manager.load(pfbKey);
        pfb = res.getResource(manager);
        dc.add(pfbKey, res.getVersion(manager));
      }
      catch (ResourceException e)
      {
        // ignore ..
      }
View Full Code Here

Examples of org.pentaho.reporting.libraries.resourceloader.ResourceData

  private byte[] loadDataFromBundle(final String href) throws ResourceKeyCreationException, ResourceLoadingException
  {
    final ResourceKey key = getRootHandler().getSource();
    final ResourceManager manager = getRootHandler().getResourceManager();
    final ResourceKey derivedKey = manager.deriveKey(key, href);
    final ResourceData data = manager.load(derivedKey);
    return data.getResource(manager);
  }
View Full Code Here

Examples of org.pentaho.reporting.libraries.resourceloader.ResourceData

    if (caller == null)
    {
      throw new NullPointerException();
    }

    final ResourceData cdata = CachingResourceData.createCached(data);
    final Object keyObject = data.getKey();
    final Object dataCacheEntry = new DefaultResourceDataCacheEntry(cdata, caller);
    dataCache.put(new Element(keyObject, dataCacheEntry));
    return cdata;
  }
View Full Code Here

Examples of org.pentaho.reporting.libraries.resourceloader.ResourceData

  {
  }

  public ResourceData put(final ResourceManager caller, final ResourceData data) throws ResourceLoadingException
  {
    final ResourceData retval = CachingResourceData.createCached(data);
    lastEntry = new WeakReference(new DefaultResourceDataCacheEntry(retval, caller));
    return retval;
  }
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.