Package freenet.node

Examples of freenet.node.FSParseException


  }

  private AddressTracker(SimpleFieldSet fs, long lastBootID) throws FSParseException {
    int version = fs.getInt("Version");
    if(version != 2)
      throw new FSParseException("Unknown Version "+version);
    long savedBootID = fs.getLong("BootID");
    if(savedBootID != lastBootID) throw new FSParseException("Unable to load address tracker table, assuming an unclean shutdown: Last ID was " +
        lastBootID+" but stored "+savedBootID);
    // Sadly we don't know whether there were packets arriving during the gap,
    // and some insecure firewalls will use incoming packets to keep tunnels open
    //timeDefinitelyNoPacketsReceived = fs.getLong("TimeDefinitelyNoPacketsReceived");
    timeDefinitelyNoPacketsReceivedPeer = System.currentTimeMillis();
View Full Code Here


  public PeerAddressTrackerItem(SimpleFieldSet fs) throws FSParseException {
    super(fs);
    try {
      peer = new Peer(fs.getString("Address"), false);
    } catch (UnknownHostException e) {
      throw (FSParseException)new FSParseException("Unknown domain name in Address: "+e).initCause(e);
    } catch (PeerParseException e) {
      throw new FSParseException(e);
    }
  }
View Full Code Here

  public InetAddressAddressTrackerItem(SimpleFieldSet fs) throws FSParseException {
    super(fs);
    try {
      addr = InetAddress.getByName(fs.getString("Address"));
    } catch (UnknownHostException e) {
      throw (FSParseException)new FSParseException("Unknown domain name in Address: "+e).initCause(e);
    }
  }
View Full Code Here

        setName(name);
    }

    public BookmarkCategory(SimpleFieldSet sfs) throws FSParseException {
  String aName = sfs.get("Name");
  if(aName == null) throw new FSParseException("No Name!");
  setName(aName);
    }
View Full Code Here

            String name = (isRoot ? "" : prefix + category.name) + '/' + item.name;
            putPaths(name, item);
            category.addBookmark(item);
            subscribeToUSK(item);
          } catch(MalformedURLException e) {
            throw new FSParseException(e);
          }
        }

        for(int i = 0; i < nbCategories; i++) {
          SimpleFieldSet subset = sfs.getSubset(BookmarkCategory.NAME + i);
View Full Code Here

            KeyFactory kf = KeyFactory.getInstance("EC", curve.kfProvider);
            ECPrivateKey privK = (ECPrivateKey) kf.generatePrivate(ks);

            this.key = new KeyPair(pubK, privK);
        } catch (Exception e) {
            throw new FSParseException(e);
        }
        this.curve = curve;
    }
View Full Code Here

   * Like subset(), only throws instead of returning null.
   * @throws FSParseException
   */
  public synchronized SimpleFieldSet getSubset(String key) throws FSParseException {
    SimpleFieldSet fs = subset(key);
    if(fs == null) throw new FSParseException("No such subset "+key);
    return fs;
  }
View Full Code Here

     * @throws FSParseException If the key=value pair does not exist or if the value cannot be
     * parsed as an integer.
     */
  public int getInt(String key) throws FSParseException {
    String s = get(key);
    if(s == null) throw new FSParseException("No key "+key);
    try {
      return Integer.parseInt(s);
    } catch (NumberFormatException e) {
      throw new FSParseException("Cannot parse "+s+" for integer "+key);
    }
  }
View Full Code Here

     * @throws FSParseException If the key=value pair does not exist or if the value cannot be
     * parsed as a double.
     */
  public double getDouble(String key) throws FSParseException {
    String s = get(key);
    if(s == null) throw new FSParseException("No key "+key);
    try {
      return Double.parseDouble(s);
    } catch (NumberFormatException e) {
      throw new FSParseException("Cannot parse "+s+" for integer "+key);
    }
  }
View Full Code Here

     * @throws FSParseException If the key=value pair does not exist or if the value cannot be
     * parsed as a long.
     */
  public long getLong(String key) throws FSParseException {
    String s = get(key);
    if(s == null) throw new FSParseException("No key "+key);
    try {
      return Long.parseLong(s);
    } catch (NumberFormatException e) {
      throw new FSParseException("Cannot parse "+s+" for long "+key);
    }
  }
View Full Code Here

TOP

Related Classes of freenet.node.FSParseException

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.