Examples of ResourceKeyCreationException


Examples of org.jfree.resourceloader.ResourceKeyCreationException

  public ResourceKey deriveKey(ResourceKey parent, String path, Map factoryKeys)
      throws ResourceKeyCreationException
  {
    if (isSupportedKey(parent) == false)
    {
      throw new ResourceKeyCreationException("Assertation: Unsupported parent key type");
    }

    try
    {
      URL url;
      if (path != null)
      {
        url = new URL((URL) parent.getIdentifier(), path);
      }
      else
      {
        url = (URL) parent.getIdentifier();
      }

      Map map;
      if (factoryKeys != null)
      {
        map = new HashMap();
        map.putAll(parent.getFactoryParameters());
        map.putAll(factoryKeys);
      }
      else
      {
        map = parent.getFactoryParameters();
      }
      return new ResourceKey(parent.getSchema(), url, map);
    }
    catch (MalformedURLException e)
    {
      throw new ResourceKeyCreationException("Malformed value: " + path);
    }
  }
View Full Code Here

Examples of org.jfree.resourceloader.ResourceKeyCreationException

      }
    }

    if (normalizedList.isEmpty())
    {
      throw new ResourceKeyCreationException("Unable to build a valid key.");
    }
    StringBuffer buffer = new StringBuffer();
    buffer.append(parentPrefix);

    for (int i = 0; i < normalizedList.size(); i++)
View Full Code Here

Examples of org.jfree.resourceloader.ResourceKeyCreationException

  public ResourceKey deriveKey(ResourceKey parent, String path, Map factoryKeys)
      throws ResourceKeyCreationException
  {
    if (isSupportedKey(parent) == false)
    {
      throw new ResourceKeyCreationException("Assertation: Unsupported parent key type");
    }

    final String resource;
    if (path.startsWith("res://"))
    {
View Full Code Here

Examples of org.jfree.resourceloader.ResourceKeyCreationException

  public ResourceKey deriveKey(ResourceKey parent, String path, Map factoryKeys)
      throws ResourceKeyCreationException
  {
    if (path != null)
    {
      throw new ResourceKeyCreationException("Unable to derive key for new path.");
    }
    if (isSupportedKey(parent) == false)
    {
      throw new ResourceKeyCreationException("Assertation: Unsupported parent key type");
    }

    if (factoryKeys == null) return parent;

    HashMap map = new HashMap();
View Full Code Here

Examples of org.jfree.resourceloader.ResourceKeyCreationException

  public ResourceKey deriveKey(ResourceKey parent, String path, Map factoryKeys)
      throws ResourceKeyCreationException
  {
    if (isSupportedKey(parent) == false)
    {
      throw new ResourceKeyCreationException("Assertation: Unsupported parent key type");
    }

    String entry;
    if (path != null)
    {
View Full Code Here

Examples of org.jfree.resourceloader.ResourceKeyCreationException

                               final Map factoryKeys)
      throws ResourceKeyCreationException
  {
    if (isSupportedKey(parent) == false)
    {
      throw new ResourceKeyCreationException("Assertation: Unsupported parent key type");
    }

    File target;
    if (path != null)
    {
      final File parentResource = (File) parent.getIdentifier();
      target = new File(parentResource.getParentFile(), path);
      if (target.exists() == false || target.isFile() == false)
      {
        throw new ResourceKeyCreationException("Malformed value: " + path + " (" + target + ")");
      }

    }
    else
    {
View Full Code Here

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

                               final String path,
                               final Map<? extends ParameterKey, ? extends Object> factoryKeys) throws ResourceKeyCreationException
  {
    if (isSupportedKey(parent) == false)
    {
      throw new ResourceKeyCreationException("Assertation: Unsupported parent key type");
    }

    final String entry;
    final String identifier = (String) parent.getIdentifier();
    if (path != null)
    {
      if (path.length() > 0 && path.charAt(0) == '/')
      {
        entry = LoaderUtils.stripLeadingSlashes(path);
      }
      else
      {
        entry = LoaderUtils.mergePaths(identifier, path);
      }
    }
    else
    {
      entry = identifier;
    }

    final Map<ParameterKey, Object> map;
    if (factoryKeys != null)
    {
      map = new HashMap<ParameterKey, Object>();
      map.putAll(parent.getFactoryParameters());
      map.putAll(factoryKeys);
    }
    else
    {
      map = parent.getFactoryParameters();
    }

    if ("true".equals(LibDocBundleBoot.getInstance().getGlobalConfig().getConfigProperty
        ("org.pentaho.reporting.libraries.docbundle.bundleloader.directory.StrictKeyCheck", "true")))
    {
      try
      {
        final FileRepository repository = (FileRepository)
            parent.getFactoryParameters().get(new FactoryParameterKey("repository"));
        if (RepositoryUtilities.isExistsEntity(repository, RepositoryUtilities.split(entry, "/")) == false)
        {
          throw new ResourceKeyCreationException("The key does not exist: " + entry);
        }
      }
      catch (ContentIOException e)
      {
        throw new ResourceKeyCreationException("Failed to check for existing key", e);
      }
    }

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

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

                               final String path,
                               final Map<? extends ParameterKey, ? extends Object> factoryKeys) throws ResourceKeyCreationException
  {
    if (isSupportedKey(parent) == false)
    {
      throw new ResourceKeyCreationException("Assertation: Unsupported parent key type");
    }

    final String entry;
    final String identifier = (String) parent.getIdentifier();
    if (path != null)
    {
      if (path.length() > 0 && path.charAt(0) == '/')
      {
        entry = LoaderUtils.stripLeadingSlashes(path);
      }
      else
      {
        entry = LoaderUtils.mergePaths(identifier, path);
      }
    }
    else
    {
      entry = identifier;
    }

    final Map<ParameterKey, Object> map;
    if (factoryKeys != null)
    {
      map = new HashMap<ParameterKey, Object>();
      map.putAll(parent.getFactoryParameters());
      map.putAll(factoryKeys);
    }
    else
    {
      map = parent.getFactoryParameters();
    }
    if ("true".equals(LibDocBundleBoot.getInstance().getGlobalConfig().getConfigProperty
        ("org.pentaho.reporting.libraries.docbundle.bundleloader.zip.StrictKeyCheck", "true")))
    {
      try
      {
        final ZipReadRepository repository = (ZipReadRepository)
            parent.getFactoryParameters().get(new FactoryParameterKey("repository"));
        if (RepositoryUtilities.isExistsEntity(repository, RepositoryUtilities.split(entry, "/")) == false)
        {
          throw new ResourceKeyCreationException("The key does not exist: " + entry);
        }
      }
      catch (ContentIOException e)
      {
        throw new ResourceKeyCreationException("Failed to check for existing key", e);
      }
    }

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

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

      throw new NullPointerException();
    }
   
    if (isSupportedKey(parent) == false)
    {
      throw new ResourceKeyCreationException("Assertation: Unsupported parent key type");
    }

    try
    {
      final File target;
      if (path != null)
      {
        final File parentResource = (File) parent.getIdentifier();
        target = new File(parentResource.getCanonicalFile().getParentFile(), path);
        if (target.exists() == false || target.isDirectory() == false)
        {
          throw new ResourceKeyCreationException("Malformed value: " + path + " (" + target + ')');
        }

      }
      else
      {
        target = (File) parent.getIdentifier();
      }

      final Map map;
      if (factoryKeys != null)
      {
        map = new HashMap();
        map.putAll(parent.getFactoryParameters());
        map.putAll(factoryKeys);
      }
      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

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

    throw new ResourceLoadingException("This resource Loader cannot be used to create a ResourceData object.");
  }

  public ResourceKey deserialize(final ResourceKey bundleKey, final String stringKey) throws ResourceKeyCreationException
  {
    throw new ResourceKeyCreationException("This resource Loader cannot be used to deserialize ReousrceKeys");
  }
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.