Examples of ResourceData


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

        }
        else
        {
          try
          {
            final ResourceData data = resourceManager.load(url);
            // create the image
            return workbook.addPicture(data.getResource(resourceManager), format);
          }
          catch (ResourceException re)
          {
            ExcelPrinter.logger.info("Failed to load image from URL " + url, re);
          }
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

          return cached;
        }

        try
        {
          final ResourceData resourceData = resourceManager.load(url);
          final byte[] data = resourceData.getResource(resourceManager);
          final Image itextimage = Image.getInstance(data);
          cachedImages.put(identity, itextimage);
          return itextimage;
        }
        catch (ResourceException re)
View Full Code Here

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

    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

      queryLimitVal = -1;
    }

    try
    {
      final ResourceData resource = load();
      return new XPathTableModel(resource, resourceManager, xpath, parameters, queryLimitVal);
    }
    catch (ResourceException re)
    {
      throw new ReportDataFactoryException("Failed to load XML data", re);
View Full Code Here

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

    }
    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

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

      }

      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

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

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

    final ResourceData resourceData = resourceManager.load(dataKey);
    String contentType = (String) resourceData.getAttribute(ResourceData.CONTENT_TYPE);
    if (contentType == null)
    {
      contentType = "application/octet-stream";
    }

    final InputStream stream = resourceData.getResourceAsStream(resourceManager);
    try
    {
      final OutputStream outStream = bundle.createEntry(targetPath, contentType);
      try
      {
View Full Code Here

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

      throw new NullPointerException();
    }

    try
    {
      final ResourceData rawData = resourceManager.loadRawData(key);
      // A zip bundle can be recognized by using simple finger-printing
      final byte[] buffer = new byte[2];
      rawData.getResource(resourceManager, buffer, 0, 2);
      if (buffer[0] != 'P' || buffer[1] != 'K')
      {
        return null;
      }

      final InputStream stream = rawData.getResourceAsStream(resourceManager);
      try
      {
        final ZipReadRepository zipReadRepository = new ZipReadRepository(stream);
        final String bundleType = BundleUtilities.getBundleType(zipReadRepository);
        final String bundleMapping = BundleUtilities.getBundleMapping(bundleType);
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.