Package org.pentaho.reporting.libraries.resourceloader

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


    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

      }

      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

    {
      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

      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

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

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

    {
      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

    {
      throw new ResourceCreationException("Unable to parse the document", e);
    }
    catch (IOException e)
    {
      throw new ResourceLoadingException("Unable to read the stream", e);
    }

  }
View Full Code Here

        oin.close();
      }
    }
    catch (IOException e)
    {
      throw new ResourceLoadingException("Failed to load resource", e);
    }
    catch (ClassNotFoundException e)
    {
      throw new ResourceCreationException
              ("Missing class definition: Failed to create encoding.");
View Full Code Here

TOP

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

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.