Package freenet.client

Examples of freenet.client.InsertException


        if(finished) return null;
      }
      if(persistent) {
        if(sourceData == null) {
          Logger.error(this, "getBlockItem(): sourceData = null", new Exception("error"));
          fail(new InsertException(InsertExceptionMode.INTERNAL_ERROR), context);
          return null;
        }
      }
      Bucket data = sourceData.createShadow();
      FreenetURI u = uri;
      if(u.getKeyType().equals("CHK")) u = FreenetURI.EMPTY_CHK_URI;
      if(data == null) {
        data = context.tempBucketFactory.makeBucket(sourceData.size());
        BucketTools.copy(sourceData, data);
      }
      CompatibilityMode cmode = ctx.getCompatibilityMode();
      boolean pre1254 = !(cmode == CompatibilityMode.COMPAT_CURRENT || cmode.ordinal() >= CompatibilityMode.COMPAT_1255.ordinal());
      return new BlockItem(key, data, isMetadata, compressionCodec, sourceLength, u, persistent, pre1254, cryptoAlgorithm, cryptoKey);
    } catch (IOException e) {
      throw new InsertException(InsertExceptionMode.BUCKET_ERROR, e, null);
    }
  }
View Full Code Here


            BlockInsert chosen = segment.chooseBlock();
            assertTrue(chosen != null);
            keys.addRunningInsert(chosen);
            assertFalse(chosenBlocks[chosen.blockNumber]);
            chosenBlocks[chosen.blockNumber] = true;
            segment.onFailure(chosen.blockNumber, new InsertException(InsertExceptionMode.ROUTE_NOT_FOUND));
        }
        BlockInsert chosen = segment.chooseBlock();
        assertTrue(chosen == null);
        for(int i=0;i<segment.totalBlockCount;i++)
            keys.removeRunningInsert(new BlockInsert(segment, i));
View Full Code Here

    else
      return shortCodeDescription;
  }

    public InsertException getException() {
        return new InsertException(InsertExceptionMode.getByCode(code), extraDescription, tracker, null);
    }
View Full Code Here

TOP

Related Classes of freenet.client.InsertException

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.