Examples of ResourceLoadingException


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

  public ResourceData load(final ResourceKey key) throws ResourceLoadingException
  {
    if (isSupportedKey(key) == false)
    {
      throw new ResourceLoadingException("Key format is not recognized.");
    }
    return new URLResourceData(key);
  }
View Full Code Here

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

      }
      return new SimpleResource (data.getKey(), properties, Properties.class, data.getVersion(manager));
    }
    catch (IOException e)
    {
      throw new ResourceLoadingException("Failed to load the properties file.",e);
    }
  }
View Full Code Here

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

      }
      return c.getInputStream();
    }
    catch (IOException e)
    {
      throw new ResourceLoadingException("Failed to open URL connection", e);
    }
  }
View Full Code Here

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

    try
    {
      final InputStream in = getResourceAsStream(caller);
      if (in == null)
      {
        throw new ResourceLoadingException("Unable to read Stream: No input stream: " + getKey());
      }
      try
      {
        final ByteArrayOutputStream bout = new ByteArrayOutputStream();
        IOUtils.getInstance().copyStreams(in, bout);
        return bout.toByteArray();
      }
      finally
      {
        in.close();
      }
    }
    catch (ResourceLoadingException rle)
    {
      throw rle;
    }
    catch (IOException e)
    {
      throw new ResourceLoadingException("Unable to read Stream: ", e);
    }
  }
View Full Code Here

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

      }

      final InputStream in = getResourceAsStream(caller);
      if (in == null)
      {
        throw new ResourceLoadingException("Unable to read Stream: No input stream: " + getKey());
      }
      try
      {
        if (offset > 0)
        {
          long toBeSkipped = offset;
          long skipResult = in.skip(toBeSkipped);
          toBeSkipped -= skipResult;
          while (skipResult > 0 && toBeSkipped > 0)
          {
            skipResult = in.skip(offset);
            toBeSkipped -= skipResult;
          }

          if (toBeSkipped > 0)
          {
            // failed to read up to the offset ..
            throw new ResourceLoadingException
                ("Unable to read Stream: Skipping content failed: " + getKey());
          }
        }

        int bytesToRead = length;
        // the input stream does not supply accurate available() data
        // the zip entry does not know the size of the data
        int bytesRead = in.read(target, length - bytesToRead, bytesToRead);
        while (bytesRead > -1 && bytesToRead > 0)
        {
          bytesToRead -= bytesRead;
          bytesRead = in.read(target, length - bytesToRead, bytesToRead);
        }
        return length - bytesRead;
      }
      finally
      {
        in.close();
      }
    }
    catch (ResourceLoadingException rle)
    {
      throw rle;
    }
    catch (IOException e)
    {
      throw new ResourceLoadingException("Unable to read Stream: ", e);
    }
  }
View Full Code Here

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

    {
      throw new ResourceCreationException("Unable to parse the document: " + data.getKey(), e);
    }
    catch (IOException e)
    {
      throw new ResourceLoadingException("Unable to read the stream from document: " + data.getKey(), e);
    }
  }
View Full Code Here

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

      final GraphicsNode node = builder.build(ctx, document);
      return new SimpleResource(data.getKey(), new SVGDrawable(node), DrawableWrapper.class, version);
    }
    catch (IOException e)
    {
      throw new ResourceLoadingException("Failed to process SVG file", e);
    }
    catch (URISyntaxException e)
    {
      throw new ResourceLoadingException("Failed to process SVG file", e);
    }
  }
View Full Code Here

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

        stream.close();
      }
    }
    catch (IOException e)
    {
      throw new ResourceLoadingException("Failed to process WMF file", e);
    }
  }
View Full Code Here

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

        stream.close();
      }
    }
    catch (IOException e)
    {
      throw new ResourceLoadingException("Failed to process WMF file", e);
    }
  }
View Full Code Here

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

    {
      throw new ResourceCreationException("Unable to parse the document: " + data.getKey(), e);
    }
    catch (IOException e)
    {
      throw new ResourceLoadingException("Unable to read the stream from document: " + data.getKey(), 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.