Package org.pentaho.reporting.libraries.resourceloader

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


      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

  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

    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

  {
  }

  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

    }
    final File ttfCache = new File(location, filename);
    try
    {
      final ResourceKey resourceKey = resourceManager.createKey(ttfCache);
      final ResourceData data = resourceManager.load(resourceKey);
      final InputStream stream = data.getResourceAsStream(resourceManager);

      final HashMap<String, FontFileRecord> cachedSeenFiles;
      final HashMap<String, DefaultFontFamily> cachedFontFamilies;
      final HashMap<String, DefaultFontFamily> cachedFullFontNames;
      final HashMap<String, DefaultFontFamily> cachedAlternateNames;
View Full Code Here

      }

      sizeLabel.setText(null);
      try
      {
        final ResourceData resourceData = resourceManager.loadRawData(bundleKey);
        final Object size = resourceData.getAttribute(ResourceData.CONTENT_LENGTH);
        if (size != null)
        {
          sizeLabel.setText(String.valueOf(size));
        }
      }
View Full Code Here

    }
    final File ttfCache = new File(location, "samples-cache.ser");// NON-NLS
    try
    {
      final ResourceKey resourceKey = resourceManager.createKey(ttfCache);
      final ResourceData data = resourceManager.load(resourceKey);
      final InputStream stream = data.getResourceAsStream(resourceManager);

      final HashMap cachedSeenFiles;

      try
      {
View Full Code Here

  {
  }

  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

  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

TOP

Related Classes of org.pentaho.reporting.libraries.resourceloader.ResourceData

Copyright © 2018 www.massapicom. 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.