Package freenet.client.async

Examples of freenet.client.async.ClientPutter


      targetURI = null;

    this.data = tempData;
    this.clientMetadata = cm;

    putter = new ClientPutter(this, data, this.uri, cm,
        ctx, priorityClass,
        isMetadata,
        this.uri.getDocName() == null ? targetFilename : null, binaryBlob, core.clientContext, overrideSplitfileKey, -1);
  }
View Full Code Here


      if(!Arrays.equals(saltedHash, foundHash))
        throw new MessageInvalidException(ProtocolErrorMessage.DIRECT_DISK_ACCESS_DENIED, "The hash doesn't match! (salt used : \""+salt+"\")", identifier, global);
    }
   
    if(logMINOR) Logger.minor(this, "data = "+data+", uploadFrom = "+uploadFrom);
    putter = new ClientPutter(this, data, this.uri, cm,
        ctx, priorityClass,
        isMetadata,
        this.uri.getDocName() == null ? targetFilename : null, binaryBlob, server.core.clientContext, message.overrideSplitfileCryptoKey, message.metadataThreshold);
  }
View Full Code Here

    return insert(insert, filenameHint, isMetadata, priority, ctx, null);
  }
 
  public FreenetURI insert(InsertBlock insert, String filenameHint, boolean isMetadata, short priority, InsertContext ctx, byte[] forceCryptoKey) throws InsertException {
    PutWaiter pw = new PutWaiter(this);
    ClientPutter put = new ClientPutter(pw, insert.getData(), insert.desiredURI, insert.clientMetadata,
        ctx, priority,
        isMetadata, filenameHint, false, core.clientContext, forceCryptoKey, -1);
    try {
      core.clientContext.start(put);
    } catch (PersistenceDisabledException e) {
View Full Code Here

    return insert(insert, filenameHint, isMetadata, ctx, cb, priorityClass);
  }
 
  @Override
  public ClientPutter insert(InsertBlock insert, String filenameHint, boolean isMetadata, InsertContext ctx, ClientPutCallback cb, short priority) throws InsertException {
    ClientPutter put = new ClientPutter(cb, insert.getData(), insert.desiredURI, insert.clientMetadata,
        ctx, priority,
        isMetadata, filenameHint, false, core.clientContext, null, -1);
    try {
      core.clientContext.start(put);
    } catch (PersistenceDisabledException e) {
View Full Code Here

    FreenetURI uri = ark.getInsertURI().setKeyType("USK").setSuggestedEdition(number);
   
    if(logMINOR) Logger.minor(this, "Inserting " + darknetOpennetString + " ARK: " + uri + "  contents:\n" + s);
   
    InsertContext ctx = node.clientCore.makeClient((short)0, true, false).getInsertContext(true);
    inserter = new ClientPutter(this, b, uri,
          null, // Modern ARKs easily fit inside 1KB so should be pure SSKs => no MIME type; this improves fetchability considerably
          ctx,
          RequestStarter.INTERACTIVE_PRIORITY_CLASS, false, null, false, node.clientCore.clientContext, null, -1);
   
    try {
View Full Code Here

            }

    };
    // We are inserting a binary blob so we don't need to worry about CompatibilityMode etc.
    InsertContext ctx = updateManager.node.clientCore.makeClient(RequestStarter.INTERACTIVE_PRIORITY_CLASS, false, false).getInsertContext(true);
    ClientPutter putter = new ClientPutter(callback, bucket,
      FreenetURI.EMPTY_CHK_URI, null, ctx,
      RequestStarter.INTERACTIVE_PRIORITY_CLASS, false, null, true, updateManager.node.clientCore.clientContext, null, -1);
    try {
      updateManager.node.clientCore.clientContext.start(putter);
    } catch(InsertException e1) {
View Full Code Here

    InsertContext insertContext = client.getInsertContext(true);
    Bucket bucket = new ArrayBucket(temporaryImage.getImageData());
    ClientMetadata metadata = new ClientMetadata(temporaryImage.getMimeType());
    InsertBlock insertBlock = new InsertBlock(bucket, metadata, targetUri);
    try {
      ClientPutter clientPutter = client.insert(insertBlock, false, null, false, insertContext, insertToken, RequestStarter.INTERACTIVE_PRIORITY_CLASS);
      insertToken.setClientPutter(clientPutter);
    } catch (InsertException ie1) {
      throw new SoneInsertException("Could not start image insert.", ie1);
    }
  }
View Full Code Here

      /* We do not specifiy a ClientMetaData with mimetype because that would result in the insertion of an additional CHK */
      InsertBlock ib = new InsertBlock(tempB, null, m.getInsertURI());
      InsertContext ictx = mClient.getInsertContext(true);

      ClientPutter pu = mClient.insert(ib, false, null, false, ictx, this, RequestStarter.INTERACTIVE_PRIORITY_CLASS);
      addInsert(pu);
      mPutterMessageIDs.put(pu, m.getID());
      mMessageIDs.add(m.getID());
      tempB = null;

View Full Code Here

      /* We do not specifiy a ClientMetaData with mimetype because that would result in the insertion of an additional CHK */
      InsertBlock ib = new InsertBlock(tempB, null, list.getInsertURI());
      InsertContext ictx = mClient.getInsertContext(true);

      ClientPutter pu = mClient.insert(ib, false, null, false, ictx, this, RequestStarter.INTERACTIVE_PRIORITY_CLASS);
      addInsert(pu);
      tempB = null;

      if(logDEBUG) Logger.debug(this, "Started insert of WoTOwnMessageList at request URI " + list.getURI());
    }
View Full Code Here

TOP

Related Classes of freenet.client.async.ClientPutter

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.