Package org.pentaho.reporting.libraries.resourceloader

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


        }
        catch (MalformedURLException mfue)
        {
          // we dont take this easy!
          throw new ResourceKeyCreationException("Malformed value: " + value);
        }
      }
    }

    return null;
View Full Code Here


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

        final InputResourceKey parentKey = (InputResourceKey) parent.getIdentifier();
        final String resource;
        if (path.startsWith("sun:oo://"))
View Full Code Here

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

        final InputResourceKey parentKey = (InputResourceKey) parent.getIdentifier();
        final String resource;
        if (path.startsWith("sun:oo://"))
View Full Code Here

  public ResourceKey deriveKey(final ResourceKey parent, final String path, final 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

                               final Map factoryKeys)
      throws ResourceKeyCreationException
  {
    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.isFile() == 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

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

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

        }
        catch (MalformedURLException mfue)
        {
          // we dont take this easy!
          throw new ResourceKeyCreationException("Malformed value: " + value);
        }
      }
    }

    return null;
View Full Code Here

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

    try
    {
      final URL url;
      if (path != null)
      {
        url = new URL((URL) parent.getIdentifier(), path);
      }
      else
      {
        url = (URL) 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(), url, map);
    }
    catch (MalformedURLException e)
    {
      throw new ResourceKeyCreationException("Malformed value: " + path);
    }
  }
View Full Code Here

  public ResourceKey deriveKey(final ResourceKey parent, final String path, final 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;
View Full Code Here

      }
    }

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

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

TOP

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

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.