public String getKey() { return key.toString(); }
public static String getId(FreenetURI uri) { return Base64.encodeStandardUTF8(("progressbar[URI:" + uri.toString() + "]")); }
private static String getForceValue(FreenetURI key, long time) { ByteArrayOutputStream bos = new ByteArrayOutputStream(); try{ bos.write(random); bos.write(key.toString().getBytes("UTF-8")); bos.write(Long.toString(time / FORCE_GRAIN_INTERVAL).getBytes("UTF-8")); } catch (IOException e) { throw new Error(e); } String f = HexUtil.bytesToHex(SHA256.digest(bos.toByteArray())); return f; }
public void writeTo(DataOutputStream dos) throws IOException { dos.writeInt(VERSION); // Do not write anything redundant. dos.writeInt(code.code); writePossiblyNull(extraDescription, dos); dos.writeBoolean(finalizedExpected); writePossiblyNull(redirectURI == null ? null : redirectURI.toString(), dos); }
@Override public SimpleFieldSet getFieldSet() { SimpleFieldSet fs = super.getFieldSet(); fs.putSingle("URI", uri.toString()); return fs; }
@Override public SimpleFieldSet getFieldSet() { SimpleFieldSet fs = super.getFieldSet(); fs.putSingle("URI", URI.toString()); return fs; }
@Override public SimpleFieldSet getFieldSet() { SimpleFieldSet sfs = new SimpleFieldSet(true); sfs.putSingle("InsertURI", insertURI.toString()); sfs.putSingle("RequestURI", requestURI.toString()); if(identifier != null) // is optional on these two only sfs.putSingle("Identifier", identifier); return sfs; }
@Override public SimpleFieldSet getFieldSet() { SimpleFieldSet fs = super.getFieldSet(); fs.putSingle("Name", name); fs.putSingle("URI", uri.toString()); fs.put("HasAnActivelink", hasAnAnActiveLink); return fs; }
@Test public void keyCanBeConvertedToSskWithEdition() throws MalformedURLException { FreenetURI uskUri = key.toSsk("other-site", 15, "some", "path.html"); assertThat(uskUri.toString(), is("SSK@NfUYvxDwU9vqb2mh-qdT~DYJ6U0XNbxMGGoLe0aCHJs,Miglsgix0VR56ZiPl4NgjnUd~UdrnHqIvXJ3KKHmxmI,AQACAAE/other-site-15/some/path.html")); }
private String processURI(FreenetURI furi, URI uri, String overrideType, boolean noRelative, boolean inline) { // Valid Freenet URI, allow it // Now what about the queries? HTTPRequest req = new HTTPRequestImpl(uri, "GET"); if(cb != null) cb.foundURI(furi); if(cb != null) cb.foundURI(furi, inline); return finishProcess(req, overrideType, '/' + furi.toString(false, false), uri, noRelative); }
@Override public SimpleFieldSet getFieldSet() { SimpleFieldSet fs = super.getFieldSet(); fs.putSingle("Name", name); fs.putSingle("URI", URI.toString()); fs.put("HasAnActivelink", hasAnActivelink); return fs; }
@Override public SimpleFieldSet getFieldSet() { SimpleFieldSet fs = new SimpleFieldSet(true); fs.putSingle("URI", key.getURI().toString()); fs.put("DontPoll", dontPoll); return fs; }
@Test public void keyCanBeConvertedToUsk() throws MalformedURLException { FreenetURI uskUri = key.toUsk("other-site", 15, "some", "path.html"); assertThat(uskUri.toString(), is("USK@NfUYvxDwU9vqb2mh-qdT~DYJ6U0XNbxMGGoLe0aCHJs,Miglsgix0VR56ZiPl4NgjnUd~UdrnHqIvXJ3KKHmxmI,AQACAAE/other-site/15/some/path.html")); }
@Test public void keyCanBeConvertedToSskWithoutEdition() throws MalformedURLException { FreenetURI uskUri = key.toSsk("other-site", "some", "path.html"); assertThat(uskUri.toString(), is("SSK@NfUYvxDwU9vqb2mh-qdT~DYJ6U0XNbxMGGoLe0aCHJs,Miglsgix0VR56ZiPl4NgjnUd~UdrnHqIvXJ3KKHmxmI,AQACAAE/other-site/some/path.html")); }
private Message getOldUOMAnnouncement() { boolean mainJarAvailable = transitionMainJarFetcher == null ? false : transitionMainJarFetcher.fetched(); return DMT.createUOMAnnouncement(previousMainJarUSK.toString(), revocationURI .toString(), revocationChecker.hasBlown(), mainJarAvailable ? TRANSITION_VERSION : -1, revocationChecker.lastSucceededDelta(), revocationChecker .getRevocationDNFCounter(), revocationChecker .getBlobSize(), mainJarAvailable ? transitionMainJarFetcher.getBlobSize() : -1, (int) node.nodeStats.getNodeAveragePingTime(), (int) node.nodeStats.getBwlimitDelayTime()); }
@Override public SimpleFieldSet getFieldSet() { SimpleFieldSet sfs = new SimpleFieldSet(true); sfs.putSingle("Identifier", message.identifier); sfs.putSingle("URI", message.key.getURI().toString()); sfs.put("DontPoll", message.dontPoll); return sfs; }
@Override public SimpleFieldSet getFieldSet() { SimpleFieldSet fs = new SimpleFieldSet(true); fs.putSingle("Identifier", identifier); fs.put("Global", global); // This is useful for simple clients. if(uri != null) fs.putSingle("URI", uri.toString(false, false)); fs.put("StartupTime", startupTime); fs.put("CompletionTime", completionTime); return fs; }
private HTMLNode createKeyCell(FreenetURI uri, boolean addSlash) { HTMLNode keyCell = new HTMLNode("td", "class", "request-key"); if (uri != null) { keyCell.addChild("span", "class", "key_is").addChild("a", "href", '/' + uri.toString() + (addSlash ? "/" : ""), uri.toShortString() + (addSlash ? "/" : "")); } else { keyCell.addChild("span", "class", "key_unknown", l10n("unknown")); } return keyCell; }
void addPrivateFields(SimpleFieldSet fs) { // Let's not add it twice fs.removeSubset("ecdsa"); fs.put("ecdsa", ecdsaP256.asFieldSet(true)); fs.putSingle("ark.privURI", myARK.getInsertURI().toString(false, false)); fs.putSingle("clientNonce", Base64.encode(clientNonce)); }