Examples of FetchException


Examples of freenet.client.FetchException

  // LOCKING: If transient, DO NOT call this method from within handleMetadata.
  protected void innerWrapHandleMetadata(boolean notFinalizedSize, ClientContext context) {
    try {
      handleMetadata(context);
    } catch (MetadataParseException e) {
      onFailure(new FetchException(FetchExceptionMode.INVALID_METADATA, e), false, context);
    } catch (FetchException e) {
      if(notFinalizedSize)
        e.setNotFinalizedSize();
      onFailure(e, false, context);
    } catch (ArchiveFailureException e) {
      onFailure(new FetchException(e), false, context);
    } catch (ArchiveRestartException e) {
      onFailure(new FetchException(e), false, context);
    }
  }
View Full Code Here

Examples of freenet.client.FetchException

      if(edition <= usk.suggestedEdition) {
        context.uskManager.startTemporaryBackgroundFetcher(usk, context, ctx, true, realTimeFlag);
        edition = context.uskManager.lookupKnownGood(usk);
        if(edition > usk.suggestedEdition) {
          if(logMINOR) Logger.minor(SingleFileFetcher.class, "Redirecting to edition "+edition);
          cb.onFailure(new FetchException(FetchExceptionMode.PERMANENT_REDIRECT, usk.copy(edition).getURI().addMetaStrings(metaStrings)), null, context);
          return null;
        } else if(edition == -1 &&
            context.uskManager.lookupLatestSlot(usk) == -1) { // We do not want to be going round and round here!
          // Check the datastore first.
          USKFetcherTag tag =
            context.uskManager.getFetcher(usk.copy(usk.suggestedEdition), ctx, false, requester.persistent(),
                realTimeFlag, new MyUSKFetcherCallback(requester, cb, usk, metaStrings, ctx, actx, realTimeFlag, maxRetries, recursionLevel, dontTellClientGet, l, requester.persistent(), true), false, context, true);
          if(isEssential)
            requester.addMustSucceedBlocks(1);
          return tag;
         
        } else {
          // Transition to SingleFileFetcher
          GetCompletionCallback myCB =
            new USKProxyCompletionCallback(usk, cb, requester.persistent());
          // Want to update the latest known good iff the fetch succeeds.
          SingleFileFetcher sf =
            new SingleFileFetcher(requester, myCB, null, usk.getSSK(), metaStrings,
                usk.getURI().addMetaStrings(metaStrings), 0, ctx, false, realTimeFlag, actx, null, null, maxRetries, recursionLevel,
                dontTellClientGet, l, isEssential, isFinal, false, (short)0, context, false);
          return sf;
        }
      } else {
        cb.onFailure(new FetchException(FetchExceptionMode.PERMANENT_REDIRECT, usk.copy(edition).getURI().addMetaStrings(metaStrings)), null, context);
        return null;
      }
    } else {
      // Do a thorough, blocking search
      USKFetcherTag tag =
View Full Code Here

Examples of freenet.client.FetchException

        output.close(); output = null;
        pipeOut.close(); pipeOut = null;
        pipeIn.close(); pipeIn = null;
      } catch (Throwable t) {
        Logger.error(this, "Caught "+t, t);
        onFailure(new FetchException(FetchExceptionMode.INTERNAL_ERROR, t), state, context);
        return;
      } finally {
        Closer.close(pipeOut);
        Closer.close(pipeIn);
        Closer.close(output);
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.