Package org.jfree.resourceloader

Examples of org.jfree.resourceloader.ResourceData


  private String writeRaw(final ResourceKey source) throws IOException
  {
    try
    {
      final ResourceData resourceData = resourceManager.load(source);
      final String mimeType = queryMimeType(resourceData);
      if (isValidImage(mimeType))
      {

        // lets do some voodo ..
        final ContentItem item = dataLocation.createItem
            (dataNameGenerator.generateName(extractFilename(resourceData), mimeType));
        if (item.isWriteable())
        {
          item.setAttribute(LibRepositoryBoot.REPOSITORY_DOMAIN,
              LibRepositoryBoot.CONTENT_TYPE, mimeType);

          // write it out ..
          final InputStream stream =
              resourceData.getResourceAsStream(resourceManager);
          final OutputStream outputStream = item.getOutputStream();
          IOUtils.getInstance().copyStreams
              (stream, outputStream);
          outputStream.close();
          stream.close();
View Full Code Here


  {
    if (rawData == null)
    {
      try
      {
        final ResourceData data = loader.load(source);
        rawData = data.getResource(loader);
      }
      catch (ResourceLoadingException e)
      {
        throw new IOException("Failed to load the raw data.");
      }
View Full Code Here

  {
    if (rawData == null)
    {
      try
      {
        final ResourceData data = loader.load(source);
        rawData = data.getResource(loader);
      }
      catch (ResourceLoadingException e)
      {
        throw new IOException("Failed to load the raw data.");
      }
View Full Code Here

  {
    if (rawData == null)
    {
      try
      {
        final ResourceData data = loader.load(source);
        rawData = data.getResource(loader);
      }
      catch (ResourceLoadingException e)
      {
        throw new IOException("Failed to load the raw data.");
      }
View Full Code Here

  public InputStream getResourceAsStream(final ResourceManager caller) throws ResourceLoadingException
  {
    // again, this is going to hurt the performance.
    final ResourceKey parentKey = key.getParent();
    final ResourceData data = caller.load(parentKey);

    final ZipInputStream zin = new ZipInputStream(data.getResourceAsStream(caller));
    try
    {
      try
      {
        ZipEntry zipEntry = zin.getNextEntry();
View Full Code Here

  public long getVersion(final ResourceManager caller)
          throws ResourceLoadingException
  {
    final ResourceKey parentKey = key.getParent();
    final ResourceData data = caller.load(parentKey);
    return data.getVersion(caller);
  }
View Full Code Here

  {
    if (rawData == null)
    {
      try
      {
        final ResourceData data = loader.load(source);
        rawData = data.getResource(loader);
      }
      catch (ResourceLoadingException e)
      {
        throw new IOException("Failed to load the raw data.");
      }
View Full Code Here

  private String writeRaw(final ResourceKey source) throws IOException
  {
    try
    {
      final ResourceData resourceData = resourceManager.load(source);
      final String mimeType = queryMimeType(resourceData);
      if (isValidImage(mimeType))
      {

        // lets do some voodo ..
        final ContentItem item = dataLocation.createItem
            (dataNameGenerator.generateName(extractFilename(resourceData), mimeType));
        if (item.isWriteable())
        {
          item.setAttribute(LibRepositoryBoot.REPOSITORY_DOMAIN,
              LibRepositoryBoot.CONTENT_TYPE, mimeType);

          // write it out ..
          final InputStream stream =
              resourceData.getResourceAsStream(resourceManager);
          final OutputStream outputStream = item.getOutputStream();
          IOUtils.getInstance().copyStreams
              (stream, outputStream);
          outputStream.close();
          stream.close();
View Full Code Here

   *         implementation.
   */
  public ResourceData put(ResourceManager caller, ResourceData data)
          throws ResourceLoadingException
  {
    final ResourceData cdata = CachingResourceData.createCached(data);
    final String ext = CacheUtility.externalizeKey(data.getKey());
    if (ext == null)
    {
      return cdata;
    }
View Full Code Here

  public InputStream getResourceAsStream(ResourceManager caller) throws ResourceLoadingException
  {
    // again, this is going to hurt the performance.
    final ResourceKey parentKey = key.getParent();
    final ResourceData data = caller.load(parentKey);

    final ZipInputStream zin = new ZipInputStream(data.getResourceAsStream(caller));
    try
    {
      ZipEntry zipEntry = zin.getNextEntry();
      while (zipEntry != null)
      {
View Full Code Here

TOP

Related Classes of org.jfree.resourceloader.ResourceData

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.