Package org.jfree.resourceloader

Examples of org.jfree.resourceloader.ResourceLoadingException


    {
      throw new ResourceCreationException("Failed to parse the stylesheet.");
    }
    catch (IOException e)
    {
      throw new ResourceLoadingException("Failed to load the stylesheet.");
    }
  }
View Full Code Here


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

      final WmfFile wmfFile = new WmfFile(data.getResourceAsStream(caller), -1, -1);
      return new SimpleResource (data.getKey(), wmfFile, version);
    }
    catch (IOException e)
    {
      throw new ResourceLoadingException("Failed to process WMF file", e);
    }
  }
View Full Code Here

      final Image image = wmfFile.replay();
      return new SimpleResource (data.getKey(), image, version);
    }
    catch (IOException e)
    {
      throw new ResourceLoadingException("Failed to process WMF file", e);
    }
  }
View Full Code Here

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

      properties.load(data.getResourceAsStream(manager));
      return new SimpleResource (data.getKey(), properties, data.getVersion(manager));
    }
    catch (IOException e)
    {
      throw new ResourceLoadingException("Failed to load the properties file.",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());
      }
      final ByteArrayOutputStream bout = new ByteArrayOutputStream();
      IOUtils.getInstance().copyStreams(in, bout);
      in.close();
      return bout.toByteArray();
    }
    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());
      }

      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);
      }

      in.close();
      return length - bytesRead;
    }
    catch (ResourceLoadingException rle)
    {
      throw rle;
    }
    catch (IOException e)
    {
      throw new ResourceLoadingException("Unable to read Stream: ", e);
    }
  }
View Full Code Here

  {
    final InputStream stream = ObjectUtilities.getResourceAsStream
        (resourcePath, ClassloaderResourceData.class);
    if (stream == null)
    {
      throw new ResourceLoadingException("Resource is not available: " + resourcePath);
    }
    return stream;
  }
View Full Code Here

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

TOP

Related Classes of org.jfree.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.