Package org.pentaho.reporting.libraries.resourceloader

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


    }
    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

      }

      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

    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

      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

  {
    try
    {
      final ResourceKey metaDataKey = resourceManager.deriveKey(bundleKey, "/meta.xml");
      // make sure we trigger a resource-loading exception ..
      final ResourceData metaDataBytes = resourceManager.load(metaDataKey);

      final Resource metaDataResource = resourceManager.create(metaDataKey, null, BundleMetaData.class);
      return (BundleMetaData) metaDataResource.getResource();
    }
    catch (ResourceKeyCreationException e)
View Full Code Here

  private String readBundleType()
  {
    try
    {
      final ResourceKey mimeKey = this.resourceManager.deriveKey(bundleKey, "mimetype");
      final ResourceData mimeData = this.resourceManager.load(mimeKey);
      final byte[] data = mimeData.getResource(this.resourceManager);
      return new String(data, "ASCII");
    }
    catch (Exception cioe)
    {
      return null;
View Full Code Here

    // Get a name for the resource
    final String name = BundleUtilities.getUniqueName(documentBundle, pattern);

    // Copy the resource into the bundle
    final ResourceData resourceData = sourceManager.load(source);
    final InputStream in = resourceData.getResourceAsStream(sourceManager);
    try
    {
      final OutputStream out = documentBundle.createEntry(name, mimeType);
      try
      {
View Full Code Here

          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

        object == null) {
      return valueKey;
    }

    try {
      final ResourceData resourceData = resourceManager.load(valueKey);
      final byte[] resource = resourceData.getResource(resourceManager);
      return resourceManager.createKey(resource, valueKey.getFactoryParameters());
    } catch (ResourceException e) {
      if (logger.isDebugEnabled()) {
        logger.info("Unable to normalize embedded resource-key, using ordinary key-object instead.", e);
      } else {
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.