Examples of FetchException


Examples of com.data2semantics.yasgui.shared.exceptions.FetchException

        loginResult.setIsLoggedIn(false);
        loginResult.setAuthenticationLink(OpenIdServlet.getAuthenticationURL(openIdURL, appBaseUrl, inDebugMode));
      }
    } catch (ClassNotFoundException e) {
      e.printStackTrace();
      throw new FetchException(e.getMessage(), e);
    } catch (FileNotFoundException e) {
      e.printStackTrace();
      throw new FetchException(e.getMessage(), e);
    } catch (JSONException e) {
      e.printStackTrace();
      throw new FetchException(e.getMessage(), e);
    } catch (SQLException e) {
      e.printStackTrace();
      throw new FetchException(e.getMessage(), e);
    } catch (IOException e) {
      e.printStackTrace();
      throw new FetchException(e.getMessage(), e);
    } catch (ParseException e) {
      e.printStackTrace();
      throw new FetchException(e.getMessage(), e);
    } catch (OpenIdException e) {
      //not logged in
      loginResult.setIsLoggedIn(false);
      loginResult.setAuthenticationLink(OpenIdServlet.getAuthenticationURL(openIdURL, appBaseUrl, inDebugMode));
    }
View Full Code Here

Examples of com.google.step2.http.FetchException

          XmlUtil.getDocument(new ByteArrayInputStream(documentBytes));

      xrds = new XRDS(document.getDocumentElement(), false);

    } catch (ParserConfigurationException e) {
      throw new FetchException(e);
    } catch (SAXException e) {
      throw new FetchException(e);
    } catch (IOException e) {
      throw new FetchException(e);
    } catch (URISyntaxException e) {
      throw new FetchException(e);
    } catch (ParseException e) {
      throw new FetchException(e);
    }

    return new XrdRepresentations(xrds.getFinalXRD(), uri.toASCIIString(),
        documentBytes, signature);
  }
View Full Code Here

Examples of freenet.client.FetchException

      onFailure(e, null);
    } catch (Throwable t) {
      synchronized(this) {
        started = true;
      }
      onFailure(new FetchException(FetchExceptionMode.INTERNAL_ERROR, t), null);
    }
  }
View Full Code Here

Examples of freenet.client.FetchException

    // if request is still running, send a GetFailed with code=cancelled
    if( !finished ) {
      synchronized(this) {
        succeeded = false;
        finished = true;
        FetchException cancelled = new FetchException(FetchExceptionMode.CANCELLED);
        getFailedMessage = new GetFailedMessage(cancelled, identifier, global);
      }
      trySendDataFoundOrGetFailed(null);
    }
    // notify client that request was removed
View Full Code Here

Examples of freenet.client.FetchException

  }

    public FetchException getFetchException() {
        // Data length etc have already been handled separately. Ignore them.
        if(tracker != null) {
            return new FetchException(FetchExceptionMode.getByCode(code), tracker, extraDescription);
        } else {
            return new FetchException(FetchExceptionMode.getByCode(code), extraDescription);
        }
    }
View Full Code Here

Examples of freenet.client.FetchException

      File parent = filename.getParentFile();
      if(parent == null) parent = new File(".");
      try {
        tempFile = File.createTempFile(filename.getName(), NodeUpdateManager.TEMP_FILE_SUFFIX, parent);
      } catch (InsufficientDiskSpaceException e) {
          throw new FetchException(FetchExceptionMode.NOT_ENOUGH_DISK_SPACE);
      } catch (IOException e) {
        throw new FetchException(FetchExceptionMode.BUCKET_ERROR, "Cannot create temp file for "+filename+" in "+parent+" - disk full? permissions problem?");
      }
      getter = new ClientGetter(this, 
          chk, myCtx, RequestStarter.IMMEDIATE_SPLITFILE_PRIORITY_CLASS,
          new FileBucket(tempFile, false, false, false, false), null, null);
      myCtx.eventProducer.addEventListener(this);
View Full Code Here

Examples of freenet.client.FetchException

      }
            if(!MainJarDependenciesChecker.validFile(tempFile, expectedHash, expectedLength, executable)) {
                Logger.error(this, "Unable to download dependency "+filename+" : not the expected size or hash!");
                System.err.println("Download of "+filename+" for update failed because temp file appears to be corrupted!");
                if(cb != null)
                    cb.onFailure(new FetchException(FetchExceptionMode.BUCKET_ERROR, "Downloaded jar from Freenet but failed consistency check: "+tempFile+" length "+tempFile.length()+" "));
                tempFile.delete();
                return;
            }
      if(!FileUtil.renameTo(tempFile, filename)) {
        Logger.error(this, "Unable to rename temp file "+tempFile+" to "+filename);
        System.err.println("Download of "+filename+" for update failed because cannot rename from "+tempFile);
        if(cb != null)
            cb.onFailure(new FetchException(FetchExceptionMode.BUCKET_ERROR, "Unable to rename temp file "+tempFile+" to "+filename));
                tempFile.delete();
        return;
      }
      if(cb != null) cb.onSuccess();
    }
View Full Code Here

Examples of freenet.client.FetchException

    private void checkDecodedBlock(int i, byte[] data) {
        ClientCHK key = getKey(i);
        if(key == null) {
            Logger.error(this, "Key not found");
            failOffThread(new FetchException(FetchExceptionMode.INTERNAL_ERROR, "Key not found"));
            return;
        }
        ClientCHKBlock block = encodeBlock(key, data);
        String decoded = i >= dataBlockCount ? "Encoded" : "Decoded";
        if(block == null || !key.getNodeCHK().equals(block.getKey())) {
            Logger.error(this, decoded+" cross-segment block "+i+" failed!");
            failOffThread(new FetchException(FetchExceptionMode.SPLITFILE_DECODE_ERROR, decoded+" cross-segment block does not match expected key"));
            return;
        } else {
            reportBlockToSegmentOffThread(i, key, block, data);
        }
    }
View Full Code Here

Examples of freenet.client.FetchException

  // Real onFailure
  protected void onFailure(FetchException e, boolean forceFatal, ClientContext context) {
    if(logMINOR) Logger.minor(this, "onFailure( "+e+" , "+forceFatal+")", e);
    if(parent.isCancelled() || cancelled) {
      if(logMINOR) Logger.minor(this, "Failing: cancelled");
      e = new FetchException(FetchExceptionMode.CANCELLED);
      forceFatal = true;
    }
    if(!(e.isFatal() || forceFatal) ) {
      if(retry(context)) {
        if(logMINOR) Logger.minor(this, "Retrying");
View Full Code Here

Examples of freenet.client.FetchException

  /** Will be overridden by SingleFileFetcher */
  protected void onSuccess(FetchResult data, ClientContext context) {
    if(parent.isCancelled()) {
      data.asBucket().free();
      onFailure(new FetchException(FetchExceptionMode.CANCELLED), false, context);
      return;
    }
    rcb.onSuccess(new SingleFileStreamGenerator(data.asBucket(), persistent), data.getMetadata(), null, this, context);
  }
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.