/** * Pretty print the mapping, unsorted * (unless the options param is an OrderedProperties) */ public static String toString(Properties options) { return toString((Map<?, ?>) options); }
/** * Lower-case hex with leading zeros. * Use toHexString(byte[]) to not get leading zeros * @param buf may be null (returns "") * @return String of length 2*buf.length */ public static String toString(byte buf[]) { if (buf == null) return ""; return toString(buf, buf.length); }
@Override public String toString() { StringBuilder buf = new StringBuilder(); buf.append("[DataMessage: "); buf.append("\n\tData: ").append(DataHelper.toString(_data, 64)); buf.append("]"); return buf.toString(); } }
@Override public String toString() { return "DestEntry (" + DataHelper.toString(props) + ") " + dest.toString(); } }
@Override public String toString() { return super.toString() + "/" + DataHelper.toString(getData(), 32) + "." + _valid; }
/** * Straight MD5, no salt * Will return the MD5 sum of the data, compatible with Jetty * and RFC 2617. * * Updated in 0.9.26 to use UTF-8, as implied in RFC 7616/7617 * See also http://stackoverflow.com/questions/7242316/what-encoding-should-i-use-for-http-basic-authentication * * @param fullpw non-null, plain text, already trimmed * @return lower-case hex with leading zeros, 32 chars, or null on error */ public static String md5Hex(String fullpw) { byte[] data = DataHelper.getUTF8(fullpw); byte[] sum = md5Sum(data); if (sum != null) // adds leading zeros if necessary return DataHelper.toString(sum); return null; }
if (len > _payload.length) len = _payload.length; buf.append(" first ").append(len).append(" bytes: "); buf.append(DataHelper.toString(_payload, len));
_log.info("Bad digest request: " + DataHelper.toString(args)); throw new IOException("Bad auth response");
byte[] mac = ifc.getHardwareAddress(); if (mac != null && mac.length == 6) { newMacs.add(DataHelper.toString(mac));
/** * rcv 32 byte Hashes, return as a List * @throws NPE, IllegalArgumentException, and others too */ private List<Hash> receivePeers(NodeInfo nInfo, List<BEValue> peers) throws InvalidBEncodingException { if (_log.shouldLog(Log.INFO)) _log.info("Rcvd peers from: " + nInfo); int max = Math.min(MAX_WANT * 2, peers.size()); List<Hash> rv = new ArrayList<Hash>(max); for (BEValue bev : peers) { byte[] b = bev.getBytes(); if (b.length != Hash.HASH_LENGTH) { if (_log.shouldWarn()) _log.info("Bad peers entry from: " + nInfo); continue; } //Hash h = new Hash(b); Hash h = Hash.create(b); rv.add(h); if (rv.size() >= max) break; } if (_log.shouldLog(Log.INFO)) _log.info("Rcvd " + peers.size() + " peers from: " + nInfo + ": " + DataHelper.toString(rv)); return rv; }
/** * rcv concatenated 54 byte NodeInfos, return as a List * Adds all received nodeinfos to our DHT. * @throws NPE, IllegalArgumentException, and others too */ private List<NodeInfo> receiveNodes(NodeInfo nInfo, byte[] ids) throws InvalidBEncodingException { // Azureus sends 20 int max = Math.min(3 * K, ids.length / NodeInfo.LENGTH); List<NodeInfo> rv = new ArrayList<NodeInfo>(max); for (int off = 0; off < ids.length && rv.size() < max; off += NodeInfo.LENGTH) { NodeInfo nInf = new NodeInfo(ids, off); if (_blacklist.contains(nInf.getNID())) { if (_log.shouldLog(Log.INFO)) _log.info("Ignoring blacklisted " + nInf.getNID() + " from: " + nInfo); continue; } nInf = heardAbout(nInf); rv.add(nInf); } if (_log.shouldLog(Log.INFO)) _log.info("Rcvd nodes from: " + nInfo + ": " + DataHelper.toString(rv)); return rv; }
uri == null || cnonce == null || nc == null || response == null) { if (_log.shouldLog(Log.INFO)) _log.info("Bad digest request: " + DataHelper.toString(args)); return AuthResult.AUTH_BAD_REQ; if (check != AuthResult.AUTH_GOOD) { if (_log.shouldLog(Log.INFO)) _log.info("Bad digest nonce: " + check + ' ' + DataHelper.toString(args)); return check; _log.logAlways(Log.WARN, "HTTP proxy authentication failed, user: " + user); if (_log.shouldLog(Log.INFO)) _log.info("Bad digest auth: " + DataHelper.toString(args)); return AuthResult.AUTH_BAD;
out = new FileOutputStream(file); out.write(meta.getTorrentData()); String hex = DataHelper.toString(meta.getInfoHash()); System.out.println("Created: " + file); System.out.println("InfoHash: " + hex);
throw new InvalidBEncodingException("Duplicate file path " + DataHelper.toString(file));
SimpleByteCache.release(h); if (!eq) { _log.error("Hash does not match [key=" + sessionKey + " / iv =" + DataHelper.toString(iv, iv.length) + "]", new Exception("Hash error")); return null;
_log.debug("Sending " + DataHelper.toString(states));
if (log.shouldWarn()) log.warn("Connect check fail hop " + (i+1) + " to " + i + " in tunnel (EP<-GW): " + DataHelper.toString(tunnel));
if (pkt == null) { if (_log.shouldLog(Log.WARN)) _log.info("Build packet FAIL for " + DataHelper.toString(sendNext) + " to " + peer); continue;
(_isLease ? "LS " : "RI ") + _key + " (rkey " + _rkey + ") timeout " + DataHelper.formatDuration(_timeoutMs) + " toTry: " + DataHelper.toString(_toTry)); retry();