Package freenet.support.api

Examples of freenet.support.api.Bucket.free()


    String fullMimeType = mimeType;
    mimeType = ContentFilter.stripMIMEType(mimeType);
    FilterMIMEType type = ContentFilter.getMIMEType(mimeType);
    if(type == null || ((!type.safeToRead) && type.readFilter == null)) {
      UnknownContentTypeException e = new UnknownContentTypeException(mimeType);
      data.free();
      onFailure(new FetchException(e.getFetchErrorCode(), data.size(), e, mimeType), null);
      return true;
    } else if(type.safeToRead) {
      tracker.removeFetcher(this);
      onSuccess(new FetchResult(new ClientMetadata(mimeType), data), null);
View Full Code Here


      this.mimeType = result.getMimeType();
      this.finished = true;
    }
    wakeWaiters(true);
    if(droppedData != null)
      droppedData.free();
  }

  public synchronized boolean hasData() {
    return data != null;
  }
View Full Code Here

      d = data;
      cancelled = true;
    }
    if(d != null) {
      try {
        d.free();
      } catch (Throwable t) {
        // Ensure we get to the next bit
        Logger.error(this, "Failed to free: "+t, t);
      }
    }
View Full Code Here

              readBytes += realLen;
              if(readBytes > maxArchivedFileSize) {
                addErrorElement(ctx, key, name, "File too big: "+maxArchivedFileSize+" greater than current archived file size limit "+maxArchivedFileSize, true);
                out.close();
                out = null;
                output.free();
                continue outerTAR;
              }
            }
           
          } finally {
View Full Code Here

              readBytes += realLen;
              if(readBytes > maxArchivedFileSize) {
                addErrorElement(ctx, key, name, "File too big: "+maxArchivedFileSize+" greater than current archived file size limit "+maxArchivedFileSize, true);
                out.close();
                out = null;
                output.free();
                continue outerZIP;
              }
            }
           
          } finally {
View Full Code Here

      // expect this
      return;
    } finally {
      Closer.close(decompressorInput);
      Closer.close(decompressorOutput);
      inBucket.free();
      outBucket.free();
    }
    fail("did not throw expected CompressionOutputSizeException");

  }
View Full Code Here

          new URI("http://127.0.0.1:8888/"), null, null, null);
    } finally {
      Closer.close(inputStream);
      Closer.close(outputStream);
      inputBucket.free();
      outputBucket.free();
    }
  }

  private void throwError(String shortReason, String reason) throws DataFilterException {
    // Throw an exception
View Full Code Here

      // expect this
      return;
    } finally {
      Closer.close(decompressorInput);
      Closer.close(decompressorOutput);
      inBucket.free();
      outBucket.free();
    }
    fail("did not throw expected CompressionOutputSizeException");
  }
View Full Code Here

      // expect this
      return;
    } finally {
      Closer.close(decompressorInput);
      Closer.close(decompressorOutput);
      inBucket.free();
      outBucket.free();
    }
    // TODO LOW codec doesn't actually enforce size limit
    //fail("did not throw expected CompressionOutputSizeException");
  }
View Full Code Here

      synchronized(ramBucketQueue) {
        ramBucketQueue.remove(getReference());
      }
     
      // We can free it on-thread as it's a rambucket
      toMigrate.free();
      // Might have changed already so we can't rely on currentSize!
      _hasFreed(size);
      return true;
    }
   
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.