Examples of ResourceData


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

  {
    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

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

  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

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

    // 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

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

        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

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

      return null;
    }

    try
    {
      final ResourceData resourceData = resourceManager.load(source);
      final String mimeType = queryMimeType(resourceData);
      if (isValidImage(mimeType))
      {
        // lets do some voodo ..
        final ContentItem item = dataLocation.createItem
            (dataNameGenerator.generateName(extractFilename(resourceData), mimeType));
        if (item.isWriteable())
        {
          item.setAttribute(LibRepositoryBoot.REPOSITORY_DOMAIN, LibRepositoryBoot.CONTENT_TYPE, mimeType);

          // write it out ..
          final InputStream stream = new BufferedInputStream(resourceData.getResourceAsStream(resourceManager));
          try
          {
            final OutputStream outputStream = new BufferedOutputStream(item.getOutputStream());
            try
            {
View Full Code Here

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

      {
        if (urlImage.isLoadable() && isSupportedImageFormat(url))
        {
          try
          {
            final ResourceData data = resourceManager.load(url);
            final byte[] imageData = data.getResource(resourceManager);
            final String mimeType = queryMimeType(imageData);
            final URL maybeRealURL = resourceManager.toURL(url);
            if (maybeRealURL != null)
            {
              final String originalFileName = IOUtils.getInstance().getFileName(maybeRealURL);
View Full Code Here

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

      // Embed the key into the document bundle
      String mimeType = (String) factoryParameters.get(ClassicEngineFactoryParameters.MIME_TYPE);
      final String originalValue = (String) factoryParameters.get(ClassicEngineFactoryParameters.ORIGINAL_VALUE);
      if (mimeType == null)
      {
        final ResourceData resourceData = report.getResourceManager().load(resourceKey);
        final Object originalMimeType = resourceData.getAttribute(ResourceData.CONTENT_TYPE);
        if (originalMimeType instanceof String)
        {
          mimeType = (String) originalMimeType;
        }
        else
View Full Code Here

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 (final ResourceException re)
          {
            logger.info("Failed to load image from URL " + url, re)// NON-NLS
          }
View Full Code Here

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

      {
        throw new ScriptException("Unable to load script");
      }
      try
      {
        final ResourceData loadedResource = resourceManager.load(resourceKey);
        final byte[] resource = loadedResource.getResource(resourceManager);
        return eval(new String(resource, encoding), defaultScriptLanguage);
      }
      catch (ResourceLoadingException e)
      {
        throw new ScriptException(e);
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.