Package org.pentaho.reporting.libraries.resourceloader

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


      {
        throw new ResourceKeyCreationException("Failed to check for existing key", e);
      }
    }

    return new ResourceKey(parent.getParent(), parent.getSchema(), entry, map);
  }
View Full Code Here


        final HashMap<FactoryParameterKey,Object> map = new HashMap<FactoryParameterKey,Object>();
        map.put(new FactoryParameterKey("repository"), zipReadRepository);
        map.put(new FactoryParameterKey("repository-loader"), this);

        final ResourceKey mainKey = new ResourceKey(key, ZipResourceBundleLoader.class.getName(), bundleMapping, map);
        return new RepositoryResourceBundleData(key, zipReadRepository, mainKey, false);
      }
      finally
      {
        stream.close();
View Full Code Here

      {
        throw new ResourceKeyCreationException("Failed to check for existing key", e);
      }
    }

    return new ResourceKey(parent.getParent(), parent.getSchema(), entry, map);
  }
View Full Code Here

    if (value instanceof File)
    {
      final File f = (File) value;
      if (f.exists() && f.isDirectory())
      {
        return new ResourceKey(DirectoryResourceLoader.class.getName(), f, factoryKeys);
      }
    }
    else if (value instanceof String)
    {
      final File f = new File(String.valueOf(value));
      if (f.exists() && f.isDirectory())
      {
        return new ResourceKey(DirectoryResourceLoader.class.getName(), f, factoryKeys);
      }
    }

    return null;
  }
View Full Code Here

      }
      else
      {
        map = parent.getFactoryParameters();
      }
      return new ResourceKey(parent.getSchema(), target, map);
    }
    catch (IOException ioe)
    {
      throw new ResourceKeyCreationException("Failed to create key", ioe);
    }
View Full Code Here

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

    final ResourceKey bundleKey = getBundleMainKey().getParent();
    final ResourceBundleLoader o = (ResourceBundleLoader)
        bundleKey.getFactoryParameters().get(new FactoryParameterKey("repository-loader"));
    if (o == null)
    {
      throw new ResourceKeyCreationException("Unable to create a inner-bundle key, no loader available.");
    }
    return o.deriveKey(getBundleMainKey(), entryName, factoryParameters);
View Full Code Here

    this.resourceManager = resourceManager;
    this.bundleKey = bundleKey;

    // A bundle without a manifest is not valid.
    final ResourceKey manifestDataKey = resourceManager.deriveKey(bundleKey, "/META-INF/manifest.xml");
    final Resource manifestDataResource = resourceManager.create(manifestDataKey, null, BundleManifest.class);
    manifest = (BundleManifest) manifestDataResource.getResource();

    metaData = createMetaData(resourceManager, bundleKey);
View Full Code Here

  private BundleMetaData createMetaData(final ResourceManager resourceManager, final ResourceKey bundleKey)
      throws ResourceException
  {
    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();
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)
View Full Code Here

      {
        return loader.deriveKey(parent, path, parameters);
      }
      catch (ResourceKeyCreationException rkce)
      {
        ResourceKey context = computeContextKey(parent);
        while (context != null)
        {
          try
          {
            return backend.deriveKey(context, path, parameters);
View Full Code Here

TOP

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

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.