Package freenet.clients.fcp

Examples of freenet.clients.fcp.DownloadRequestStatus


          }
         
          if(!hasIdentifier) { // delete all, because no identifier is given
            for(RequestStatus r : reqs) {
              if(r instanceof DownloadRequestStatus) {
                DownloadRequestStatus download = (DownloadRequestStatus)r;
                if(download.isPersistent() && download.hasSucceeded() && download.isTotalFinalized() && !download.toTempSpace()) {
                  identifier = download.getIdentifier();
                  fcp.removeGlobalRequestBlocking(identifier);
                }
              }
            }
          }
View Full Code Here


    StringBuffer sb = new StringBuffer();

    for(RequestStatus req: reqs) {
      if(req instanceof DownloadRequestStatus) {
        DownloadRequestStatus get = (DownloadRequestStatus)req;
        FreenetURI uri = get.getURI();
        sb.append(uri.toString());
        sb.append("\n");
      }
    }
    return sb.toString();
View Full Code Here

    long totalQueuedUploadSize = 0;

    boolean added = false;
    for(RequestStatus req: reqs) {
      if(req instanceof DownloadRequestStatus && !uploads) {
        DownloadRequestStatus download = (DownloadRequestStatus)req;
        if(download.hasSucceeded()) {
          if(download.toTempSpace())
            completedDownloadToTemp.add(download);
          else // to disk
            completedDownloadToDisk.add(download);
        } else if(download.hasFinished()) {
            FetchExceptionMode failureCode = download.getFailureCode();
          String mimeType = download.getMIMEType();
          if(mimeType == null && (failureCode == FetchExceptionMode.CONTENT_VALIDATION_UNKNOWN_MIME || failureCode == FetchExceptionMode.CONTENT_VALIDATION_BAD_MIME)) {
            Logger.error(this, "MIME type is null but failure code is "+FetchException.getMessage(failureCode)+" for "+download.getIdentifier()+" : "+download.getURI());
            mimeType = DefaultMIMETypes.DEFAULT_MIME_TYPE;
          }
          if(failureCode == FetchExceptionMode.CONTENT_VALIDATION_UNKNOWN_MIME) {
            mimeType = ContentFilter.stripMIMEType(mimeType);
            LinkedList<DownloadRequestStatus> list = failedUnknownMIMEType.get(mimeType);
            if(list == null) {
              list = new LinkedList<DownloadRequestStatus>();
              failedUnknownMIMEType.put(mimeType, list);
            }
            list.add(download);
          } else if(failureCode == FetchExceptionMode.CONTENT_VALIDATION_BAD_MIME) {
            mimeType = ContentFilter.stripMIMEType(mimeType);
            FilterMIMEType type = ContentFilter.getMIMEType(mimeType);
            LinkedList<DownloadRequestStatus> list;
            if(type == null) {
              Logger.error(this, "Bad MIME failure code yet MIME is "+mimeType+" which does not have a handler!");
              list = failedUnknownMIMEType.get(mimeType);
              if(list == null) {
                list = new LinkedList<DownloadRequestStatus>();
                failedUnknownMIMEType.put(mimeType, list);
              }
            } else {
              list = failedBadMIMEType.get(mimeType);
              if(list == null) {
                list = new LinkedList<DownloadRequestStatus>();
                failedBadMIMEType.put(mimeType, list);
              }
            }
            list.add(download);
          } else {
            failedDownload.add(download);
          }
        } else {
          short prio = download.getPriority();
          if(prio < lowestQueuedPrio)
            lowestQueuedPrio = prio;
          uncompletedDownload.add(download);
          long size = download.getDataSize();
          if(size > 0)
            totalQueuedDownloadSize += size;
        }
        added = true;
      } else if(req instanceof UploadFileRequestStatus && uploads) {
View Full Code Here

TOP

Related Classes of freenet.clients.fcp.DownloadRequestStatus

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.