Package freenet.client

Examples of freenet.client.ClientMetadata


        KeysFetchingLocally keys = new MyKeysFetchingLocally();
        InsertContext context = baseContext.clone();
        context.consecutiveRNFsCountAsSuccess = 0;
        context.maxInsertRetries = 2;
        SplitFileInserterStorage storage = new SplitFileInserterStorage(data, size, cb, null,
                new ClientMetadata(), false, null, smallRAFFactory, true, context,
                cryptoAlgorithm, cryptoKey, null, hashes, smallBucketFactory, checker,
                r, memoryLimitedJobRunner, jobRunner, ticker, keys, false, 0, 0, 0, 0);
        storage.start();
        cb.waitForFinishedEncode();
        assertEquals(storage.segments.length, 1);
View Full Code Here


        MyKeysFetchingLocally keys = new MyKeysFetchingLocally();
        InsertContext context = baseContext.clone();
        context.consecutiveRNFsCountAsSuccess = 0;
        context.maxInsertRetries = 1;
        SplitFileInserterStorage storage = new SplitFileInserterStorage(data, size, cb, null,
                new ClientMetadata(), false, null, smallRAFFactory, true, context,
                cryptoAlgorithm, cryptoKey, null, hashes, smallBucketFactory, checker,
                r, memoryLimitedJobRunner, jobRunner, ticker, keys, false, 0, 0, 0, 0);
        storage.start();
        cb.waitForFinishedEncode();
        assertEquals(storage.segments.length, 1);
View Full Code Here

    else
      // Always copy if persistent
      this.metaStrings = new ArrayList<String>(metaStrings);
    this.addedMetaStrings = addedMetaStrings;
    if(logMINOR) Logger.minor(this, "Metadata: "+metadata);
    this.clientMetadata = (metadata != null ? metadata.clone() : new ClientMetadata());
    if(hasInitialMetadata)
      thisKey = FreenetURI.EMPTY_CHK_URI;
    else
      thisKey = key.getURI();
    if(origURI == null) throw new NullPointerException();
View Full Code Here

    this.dontTellClientGet = fetcher.dontTellClientGet;
    this.actx = fetcher.actx;
    this.ah = fetcher.ah;
    if(persistent && ah != null) ah = ah.cloneHandler();
    this.archiveMetadata = null;
    this.clientMetadata = (fetcher.clientMetadata != null ? fetcher.clientMetadata.clone() : new ClientMetadata());
    this.metadata = newMeta;
    this.metaStrings = new ArrayList<String>();
    this.addedMetaStrings = 0;
    this.recursionLevel = fetcher.recursionLevel + 1;
    if(recursionLevel > ctx.maxRecursionLevel)
View Full Code Here

            int dataBlocks = originalDataBlocks.length;
            assertTrue(dataBlocks <= MAX_SEGMENT_SIZE);
            assertTrue(dataBlocks + checkBlocks <= MAX_SEGMENT_SIZE);
            byte[][] originalCheckBlocks = constructBlocks(checkBlocks);
            codec.encode(originalDataBlocks, originalCheckBlocks, falseArray(checkBlocks), BLOCK_SIZE);
            ClientMetadata cm = new ClientMetadata(mime);
            // FIXME no hashes for now.
            // FIXME no compression for now.
            byte[] cryptoKey = randomKey();
            byte cryptoAlgorithm = Key.ALGO_AES_CTR_256_SHA256;
            ClientCHK[] dataKeys = makeKeys(originalDataBlocks, cryptoKey, cryptoAlgorithm);
View Full Code Here

                byte[][] segmentCheckBlocks = Arrays.copyOfRange(originalCheckBlocks, startCheckBlock, startCheckBlock + segmentCheckBlockCount[seg]);
                codec.encode(segmentDataBlocks, segmentCheckBlocks, falseArray(segmentCheckBlocks.length), BLOCK_SIZE);
                startDataBlock += segmentDataBlockCount[seg];
                startCheckBlock += segmentCheckBlockCount[seg];
            }
            ClientMetadata cm = new ClientMetadata(mime);
            // FIXME no hashes for now.
            // FIXME no compression for now.
            byte[] cryptoKey = randomKey();
            byte cryptoAlgorithm = Key.ALGO_AES_CTR_256_SHA256;
            ClientCHK[] dataKeys = makeKeys(originalDataBlocks, cryptoKey, cryptoAlgorithm);
View Full Code Here

        MyCallback cb = new MyCallback(insert);
        InsertContext context = baseContext.clone();
        context.maxInsertRetries = 2;
        ClientRequestSelector keys = new ClientRequestSelector(true, false, false, null);
        SplitFileInserterStorage storage = new SplitFileInserterStorage(data, size, cb, null,
                new ClientMetadata(), false, null, smallRAFFactory, false, context,
                cryptoAlgorithm, cryptoKey, null, hashes, smallBucketFactory, checker,
                r, memoryLimitedJobRunner, jobRunner, ticker, keys, false, 0, 0, 0, 0);
        storage.start();
        cb.waitForFinishedEncode();
        assertEquals(storage.segments.length, 1);
View Full Code Here

    String filenameHint = image.getId() + "." + temporaryImage.getMimeType().substring(temporaryImage.getMimeType().lastIndexOf("/") + 1);
    InsertableClientSSK key = InsertableClientSSK.createRandom(node.random, "");
    FreenetURI targetUri = key.getInsertURI().setDocName(filenameHint);
    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) {
View Full Code Here

TOP

Related Classes of freenet.client.ClientMetadata

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.