This commit is contained in:
zzz
2011-05-23 19:16:33 +00:00
parent 4ea5622842
commit 7ab95d0144
21 changed files with 79 additions and 74 deletions

View File

@ -156,7 +156,7 @@ class AddressBook {
/** /**
* Return an iterator over the addresses in the AddressBook. * Return an iterator over the addresses in the AddressBook.
* @since 0.8.6 * @since 0.8.7
*/ */
public Iterator<Map.Entry<String, String>> iterator() { public Iterator<Map.Entry<String, String>> iterator() {
if (this.subFile != null) if (this.subFile != null)
@ -166,7 +166,7 @@ class AddressBook {
/** /**
* Delete the temp file or clear the map. * Delete the temp file or clear the map.
* @since 0.8.6 * @since 0.8.7
*/ */
public void delete() { public void delete() {
if (this.subFile != null) { if (this.subFile != null) {

View File

@ -38,7 +38,7 @@ import java.util.NoSuchElementException;
* Callers should iterate all the way through or call close() * Callers should iterate all the way through or call close()
* to ensure the underlying stream is closed. * to ensure the underlying stream is closed.
* *
* @since 0.8.6 * @since 0.8.7
*/ */
class ConfigIterator implements Iterator<Map.Entry<String, String>> { class ConfigIterator implements Iterator<Map.Entry<String, String>> {

View File

@ -109,7 +109,7 @@ public class Daemon {
* @param log * @param log
* The log to write changes and conflicts to. * The log to write changes and conflicts to.
* May be null. * May be null.
* @since 0.8.6 * @since 0.8.7
*/ */
public static void update(NamingService router, File published, SubscriptionList subscriptions, Log log) { public static void update(NamingService router, File published, SubscriptionList subscriptions, Log log) {
// If the NamingService is a database, we look up as we go. // If the NamingService is a database, we look up as we go.

View File

@ -67,7 +67,7 @@ class DaemonThread extends Thread implements NamingServiceUpdater {
/** /**
* The NamingServiceUpdater interface * The NamingServiceUpdater interface
* @param options ignored * @param options ignored
* @since 0.8.6 * @since 0.8.7
*/ */
public void update(Properties options) { public void update(Properties options) {
interrupt(); interrupt();

View File

@ -207,12 +207,12 @@ class SummaryListener implements RateSummaryListener {
long now() { return _context.clock().now(); } long now() { return _context.clock().now(); }
/** @since 0.8.6 */ /** @since 0.8.7 */
String getBackendName() { String getBackendName() {
return _isPersistent ? RrdNioBackendFactory.NAME : RrdMemoryBackendFactory.NAME; return _isPersistent ? RrdNioBackendFactory.NAME : RrdMemoryBackendFactory.NAME;
} }
/** @since 0.8.6 */ /** @since 0.8.7 */
int getRows() { int getRows() {
return _rows; return _rows;
} }

View File

@ -73,7 +73,7 @@ public class AddressBean
/** /**
* The Unicode name, translated from Punycode * The Unicode name, translated from Punycode
* @return the original string on error * @return the original string on error
* @since 0.8.6 * @since 0.8.7
*/ */
public String getDisplayName() public String getDisplayName()
{ {
@ -83,7 +83,7 @@ public class AddressBean
/** /**
* The Unicode name, translated from Punycode * The Unicode name, translated from Punycode
* @return the original string on error * @return the original string on error
* @since 0.8.6 * @since 0.8.7
*/ */
public static String toUnicode(String host) { public static String toUnicode(String host) {
if (haveIDN) if (haveIDN)
@ -93,7 +93,7 @@ public class AddressBean
/** /**
* Is the ASCII name Punycode-encoded? * Is the ASCII name Punycode-encoded?
* @since 0.8.6 * @since 0.8.7
*/ */
public boolean isIDN() public boolean isIDN()
{ {
@ -110,7 +110,7 @@ public class AddressBean
* @param name will be converted to lower case * @param name will be converted to lower case
* @return name converted to lower case and punycoded if necessary * @return name converted to lower case and punycoded if necessary
* @throws IAE on various errors or if IDN is needed but not available * @throws IAE on various errors or if IDN is needed but not available
* @since 0.8.6 * @since 0.8.7
*/ */
static String toASCII(String host) throws IllegalArgumentException { static String toASCII(String host) throws IllegalArgumentException {
host = host.toLowerCase(); host = host.toLowerCase();
@ -159,7 +159,7 @@ public class AddressBean
return host; return host;
} }
/** @since 0.8.6 */ /** @since 0.8.7 */
public String getB32() public String getB32()
{ {
byte[] dest = Base64.decode(destination); byte[] dest = Base64.decode(destination);
@ -169,12 +169,12 @@ public class AddressBean
return Base32.encode(hash) + ".b32.i2p"; return Base32.encode(hash) + ".b32.i2p";
} }
/** @since 0.8.6 */ /** @since 0.8.7 */
public void setProperties(Properties p) { public void setProperties(Properties p) {
props = p; props = p;
} }
/** @since 0.8.6 */ /** @since 0.8.7 */
public String getSource() { public String getSource() {
String rv = getProp("s"); String rv = getProp("s");
if (rv.startsWith("http://")) if (rv.startsWith("http://"))
@ -182,25 +182,25 @@ public class AddressBean
return rv; return rv;
} }
/** @since 0.8.6 */ /** @since 0.8.7 */
public String getAdded() { public String getAdded() {
return getDate("a"); return getDate("a");
} }
/** @since 0.8.6 */ /** @since 0.8.7 */
public String getModded() { public String getModded() {
return getDate("m"); return getDate("m");
} }
/** @since 0.8.6 */ /** @since 0.8.7 */
public String getNotes() { public String getNotes() {
return getProp("notes"); return getProp("notes");
} }
/** /**
* Do this the easy way * Do this the easy way
* @since 0.8.6 * @since 0.8.7
*/ */
public String getCert() { public String getCert() {
// (4 / 3) * (pubkey length + signing key length) // (4 / 3) * (pubkey length + signing key length)
@ -224,7 +224,7 @@ public class AddressBean
} }
} }
/** @since 0.8.6 */ /** @since 0.8.7 */
private String getProp(String p) { private String getProp(String p) {
if (props == null) if (props == null)
return ""; return "";
@ -232,7 +232,7 @@ public class AddressBean
return rv != null ? rv : ""; return rv != null ? rv : "";
} }
/** @since 0.8.6 */ /** @since 0.8.7 */
private String getDate(String key) { private String getDate(String key) {
String d = getProp(key); String d = getProp(key);
if (d.length() > 0) { if (d.length() > 0) {

View File

@ -443,7 +443,7 @@ public class AddressbookBean
/** /**
* @return beginning index into results * @return beginning index into results
* @since 0.8.6 * @since 0.8.7
*/ */
public String getResultBegin() { public String getResultBegin() {
return isPrefiltered() ? "0" : Integer.toString(getBeginInt()); return isPrefiltered() ? "0" : Integer.toString(getBeginInt());
@ -465,7 +465,7 @@ public class AddressbookBean
/** /**
* @return ending index into results * @return ending index into results
* @since 0.8.6 * @since 0.8.7
*/ */
public String getResultEnd() { public String getResultEnd() {
return Integer.toString(isPrefiltered() ? resultSize() - 1 : getEndInt()); return Integer.toString(isPrefiltered() ? resultSize() - 1 : getEndInt());
@ -480,7 +480,7 @@ public class AddressbookBean
/** /**
* Does the entries map contain only the lookup result, * Does the entries map contain only the lookup result,
* or must we index into it? * or must we index into it?
* @since 0.8.6 * @since 0.8.7
*/ */
protected boolean isPrefiltered() { protected boolean isPrefiltered() {
return false; return false;
@ -488,7 +488,7 @@ public class AddressbookBean
/** /**
* @return the size of the lookup result * @return the size of the lookup result
* @since 0.8.6 * @since 0.8.7
*/ */
protected int resultSize() { protected int resultSize() {
return entries.length; return entries.length;
@ -496,7 +496,7 @@ public class AddressbookBean
/** /**
* @return the total size of the address book * @return the total size of the address book
* @since 0.8.6 * @since 0.8.7
*/ */
protected int totalSize() { protected int totalSize() {
return entries.length; return entries.length;
@ -517,7 +517,7 @@ public class AddressbookBean
return Messages.getString(s, o, o2); return Messages.getString(s, o, o2);
} }
/** translate (ngettext) @since 0.8.6 */ /** translate (ngettext) @since 0.8.7 */
protected static String ngettext(String s, String p, int n) { protected static String ngettext(String s, String p, int n) {
return Messages.getString(n, s, p); return Messages.getString(n, s, p);
} }

View File

@ -8,7 +8,7 @@ import net.i2p.I2PAppContext;
/** /**
* Format a date in local time zone * Format a date in local time zone
* @since 0.8.6 * @since 0.8.7
*/ */
public abstract class FormatDate public abstract class FormatDate
{ {

View File

@ -32,7 +32,7 @@ public class Messages {
return Translate.getString(s, o, o2, I2PAppContext.getGlobalContext(), BUNDLE_NAME); return Translate.getString(s, o, o2, I2PAppContext.getGlobalContext(), BUNDLE_NAME);
} }
/** translate (ngettext) @since 0.8.6 */ /** translate (ngettext) @since 0.8.7 */
public static String getString(int n, String s, String p) { public static String getString(int n, String s, String p) {
return Translate.getString(n, s, p, I2PAppContext.getGlobalContext(), BUNDLE_NAME); return Translate.getString(n, s, p, I2PAppContext.getGlobalContext(), BUNDLE_NAME);
} }

View File

@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
* *
* @since 0.8.6 * @since 0.8.7
*/ */
package i2p.susi.dns; package i2p.susi.dns;
@ -41,7 +41,7 @@ import net.i2p.data.Destination;
* Talk to the NamingService API instead of modifying the hosts.txt files directly, * Talk to the NamingService API instead of modifying the hosts.txt files directly,
* except for the 'published' addressbook. * except for the 'published' addressbook.
* *
* @since 0.8.6 * @since 0.8.7
*/ */
public class NamingServiceBean extends AddressbookBean public class NamingServiceBean extends AddressbookBean
{ {

View File

@ -70,6 +70,8 @@ import net.metanotion.util.skiplist.SkipList;
* </pre> * </pre>
* *
* All host names are converted to lower case. * All host names are converted to lower case.
*
* @since 0.8.7
*/ */
public class BlockfileNamingService extends DummyNamingService { public class BlockfileNamingService extends DummyNamingService {

View File

@ -86,7 +86,7 @@ class DummyNamingService extends NamingService {
} }
} }
/** @since 0.8.5 */ /** @since 0.8.7 */
protected static void removeCache(String s) { protected static void removeCache(String s) {
synchronized (_cache) { synchronized (_cache) {
_cache.remove(s); _cache.remove(s);

View File

@ -49,7 +49,7 @@ public class MetaNamingService extends DummyNamingService {
/** /**
* @param services if non-null, services to be added. If null, this will only handle b32 and b64, * @param services if non-null, services to be added. If null, this will only handle b32 and b64,
* until addNamingService() is called later. * until addNamingService() is called later.
* @since 0.8.5 * @since 0.8.7
*/ */
public MetaNamingService(I2PAppContext context, List<NamingService> services) { public MetaNamingService(I2PAppContext context, List<NamingService> services) {
super(context); super(context);

View File

@ -97,7 +97,7 @@ public abstract class NamingService {
/** /**
* @return Class simple name by default * @return Class simple name by default
* @since 0.8.5 * @since 0.8.7
*/ */
public String getName() { public String getName() {
return getClass().getSimpleName(); return getClass().getSimpleName();
@ -105,7 +105,7 @@ public abstract class NamingService {
/** /**
* @return NamingService-specific options or null * @return NamingService-specific options or null
* @since 0.8.5 * @since 0.8.7
*/ */
public Properties getConfiguration() { public Properties getConfiguration() {
return null; return null;
@ -113,7 +113,7 @@ public abstract class NamingService {
/** /**
* @return success * @return success
* @since 0.8.5 * @since 0.8.7
*/ */
public boolean setConfiguration(Properties p) { public boolean setConfiguration(Properties p) {
return true; return true;
@ -123,7 +123,7 @@ public abstract class NamingService {
/** /**
* @return chained naming services or null * @return chained naming services or null
* @since 0.8.5 * @since 0.8.7
*/ */
public List<NamingService> getNamingServices() { public List<NamingService> getNamingServices() {
return null; return null;
@ -131,7 +131,7 @@ public abstract class NamingService {
/** /**
* @return parent naming service or null if this is the root * @return parent naming service or null if this is the root
* @since 0.8.5 * @since 0.8.7
*/ */
public NamingService getParent() { public NamingService getParent() {
return null; return null;
@ -158,7 +158,7 @@ public abstract class NamingService {
/** /**
* Only for chaining-capable NamingServices * Only for chaining-capable NamingServices
* @return success * @return success
* @since 0.8.5 * @since 0.8.7
*/ */
public boolean removeNamingService(NamingService ns) { public boolean removeNamingService(NamingService ns) {
return false; return false;
@ -170,7 +170,7 @@ public abstract class NamingService {
/** /**
* @return number of entries or -1 if unknown * @return number of entries or -1 if unknown
* @since 0.8.5 * @since 0.8.7
*/ */
public int size() { public int size() {
return size(null); return size(null);
@ -179,7 +179,7 @@ public abstract class NamingService {
/** /**
* @param options NamingService-specific, can be null * @param options NamingService-specific, can be null
* @return number of entries (matching the options if non-null) or -1 if unknown * @return number of entries (matching the options if non-null) or -1 if unknown
* @since 0.8.5 * @since 0.8.7
*/ */
public int size(Properties options) { public int size(Properties options) {
return -1; return -1;
@ -189,7 +189,7 @@ public abstract class NamingService {
* @return all mappings * @return all mappings
* or empty Map if none; * or empty Map if none;
* Returned Map is not necessarily sorted, implementation dependent * Returned Map is not necessarily sorted, implementation dependent
* @since 0.8.5 * @since 0.8.7
*/ */
public Map<String, Destination> getEntries() { public Map<String, Destination> getEntries() {
return getEntries(null); return getEntries(null);
@ -200,7 +200,7 @@ public abstract class NamingService {
* @return all mappings (matching the options if non-null) * @return all mappings (matching the options if non-null)
* or empty Map if none; * or empty Map if none;
* Returned Map is not necessarily sorted, implementation dependent * Returned Map is not necessarily sorted, implementation dependent
* @since 0.8.5 * @since 0.8.7
*/ */
public Map<String, Destination> getEntries(Properties options) { public Map<String, Destination> getEntries(Properties options) {
return Collections.EMPTY_MAP; return Collections.EMPTY_MAP;
@ -212,7 +212,7 @@ public abstract class NamingService {
* @return all mappings (matching the options if non-null) * @return all mappings (matching the options if non-null)
* or empty Map if none; * or empty Map if none;
* Returned Map is not necessarily sorted, implementation dependent * Returned Map is not necessarily sorted, implementation dependent
* @since 0.8.5 * @since 0.8.7
*/ */
public Map<String, String> getBase64Entries(Properties options) { public Map<String, String> getBase64Entries(Properties options) {
return Collections.EMPTY_MAP; return Collections.EMPTY_MAP;
@ -222,7 +222,7 @@ public abstract class NamingService {
* @return all known host names * @return all known host names
* or empty Set if none; * or empty Set if none;
* Returned Set is not necessarily sorted, implementation dependent * Returned Set is not necessarily sorted, implementation dependent
* @since 0.8.5 * @since 0.8.7
*/ */
public Set<String> getNames() { public Set<String> getNames() {
return getNames(null); return getNames(null);
@ -233,7 +233,7 @@ public abstract class NamingService {
* @return all known host names (matching the options if non-null) * @return all known host names (matching the options if non-null)
* or empty Set if none; * or empty Set if none;
* Returned Set is not necessarily sorted, implementation dependent * Returned Set is not necessarily sorted, implementation dependent
* @since 0.8.5 * @since 0.8.7
*/ */
public Set<String> getNames(Properties options) { public Set<String> getNames(Properties options) {
return Collections.EMPTY_SET; return Collections.EMPTY_SET;
@ -241,7 +241,7 @@ public abstract class NamingService {
/** /**
* @return success * @return success
* @since 0.8.5 * @since 0.8.7
*/ */
public boolean put(String hostname, Destination d) { public boolean put(String hostname, Destination d) {
return put(hostname, d, null); return put(hostname, d, null);
@ -250,7 +250,7 @@ public abstract class NamingService {
/** /**
* @param options NamingService-specific, can be null * @param options NamingService-specific, can be null
* @return success * @return success
* @since 0.8.5 * @since 0.8.7
*/ */
public boolean put(String hostname, Destination d, Properties options) { public boolean put(String hostname, Destination d, Properties options) {
return false; return false;
@ -259,7 +259,7 @@ public abstract class NamingService {
/** /**
* Fails if entry previously exists * Fails if entry previously exists
* @return success * @return success
* @since 0.8.5 * @since 0.8.7
*/ */
public boolean putIfAbsent(String hostname, Destination d) { public boolean putIfAbsent(String hostname, Destination d) {
return putIfAbsent(hostname, d, null); return putIfAbsent(hostname, d, null);
@ -269,7 +269,7 @@ public abstract class NamingService {
* Fails if entry previously exists * Fails if entry previously exists
* @param options NamingService-specific, can be null * @param options NamingService-specific, can be null
* @return success * @return success
* @since 0.8.5 * @since 0.8.7
*/ */
public boolean putIfAbsent(String hostname, Destination d, Properties options) { public boolean putIfAbsent(String hostname, Destination d, Properties options) {
return false; return false;
@ -278,7 +278,7 @@ public abstract class NamingService {
/** /**
* @param options NamingService-specific, can be null * @param options NamingService-specific, can be null
* @return success * @return success
* @since 0.8.5 * @since 0.8.7
*/ */
public boolean putAll(Map<String, Destination> entries, Properties options) { public boolean putAll(Map<String, Destination> entries, Properties options) {
boolean rv = true; boolean rv = true;
@ -294,7 +294,7 @@ public abstract class NamingService {
* @param d may be null if only options are changing * @param d may be null if only options are changing
* @param options NamingService-specific, can be null * @param options NamingService-specific, can be null
* @return success * @return success
* @since 0.8.5 * @since 0.8.7
*/ */
public boolean update(String hostname, Destination d, Properties options) { public boolean update(String hostname, Destination d, Properties options) {
return false; return false;
@ -302,7 +302,7 @@ public abstract class NamingService {
/** /**
* @return success * @return success
* @since 0.8.5 * @since 0.8.7
*/ */
public boolean remove(String hostname) { public boolean remove(String hostname) {
return remove(hostname, null); return remove(hostname, null);
@ -311,7 +311,7 @@ public abstract class NamingService {
/** /**
* @param options NamingService-specific, can be null * @param options NamingService-specific, can be null
* @return success * @return success
* @since 0.8.5 * @since 0.8.7
*/ */
public boolean remove(String hostname, Properties options) { public boolean remove(String hostname, Properties options) {
return false; return false;
@ -320,7 +320,7 @@ public abstract class NamingService {
/** /**
* Ask any registered updaters to update now * Ask any registered updaters to update now
* @param options NamingService- or updater-specific, may be null * @param options NamingService- or updater-specific, may be null
* @since 0.8.5 * @since 0.8.7
*/ */
public void requestUpdate(Properties options) { public void requestUpdate(Properties options) {
for (NamingServiceUpdater nsu : _updaters) { for (NamingServiceUpdater nsu : _updaters) {
@ -329,28 +329,28 @@ public abstract class NamingService {
} }
/** /**
* @since 0.8.5 * @since 0.8.7
*/ */
public void registerListener(NamingServiceListener nsl) { public void registerListener(NamingServiceListener nsl) {
_listeners.add(nsl); _listeners.add(nsl);
} }
/** /**
* @since 0.8.5 * @since 0.8.7
*/ */
public void unregisterListener(NamingServiceListener nsl) { public void unregisterListener(NamingServiceListener nsl) {
_listeners.remove(nsl); _listeners.remove(nsl);
} }
/** /**
* @since 0.8.6 * @since 0.8.7
*/ */
public void registerUpdater(NamingServiceUpdater nsu) { public void registerUpdater(NamingServiceUpdater nsu) {
_updaters.add(nsu); _updaters.add(nsu);
} }
/** /**
* @since 0.8.6 * @since 0.8.7
*/ */
public void unregisterUpdater(NamingServiceUpdater nsu) { public void unregisterUpdater(NamingServiceUpdater nsu) {
_updaters.remove(nsu); _updaters.remove(nsu);
@ -363,7 +363,7 @@ public abstract class NamingService {
* @param lookupOptions input parameter, NamingService-specific, can be null * @param lookupOptions input parameter, NamingService-specific, can be null
* @param storedOptions output parameter, NamingService-specific, any stored properties will be added if non-null * @param storedOptions output parameter, NamingService-specific, any stored properties will be added if non-null
* @return dest or null * @return dest or null
* @since 0.8.5 * @since 0.8.7
*/ */
public abstract Destination lookup(String hostname, Properties lookupOptions, Properties storedOptions); public abstract Destination lookup(String hostname, Properties lookupOptions, Properties storedOptions);
@ -371,7 +371,7 @@ public abstract class NamingService {
* Same as reverseLookup(dest) but with options * Same as reverseLookup(dest) but with options
* @param options NamingService-specific, can be null * @param options NamingService-specific, can be null
* @return host name or null * @return host name or null
* @since 0.8.5 * @since 0.8.7
*/ */
public String reverseLookup(Destination d, Properties options) { public String reverseLookup(Destination d, Properties options) {
return null; return null;
@ -383,7 +383,7 @@ public abstract class NamingService {
* @param hostname must be {52 chars}.b32.i2p * @param hostname must be {52 chars}.b32.i2p
* @param timeout in seconds; <= 0 means use router default * @param timeout in seconds; <= 0 means use router default
* @return dest or null * @return dest or null
* @since 0.8.5 * @since 0.8.7
*/ */
public Destination lookupBase32(String hostname, int timeout) { public Destination lookupBase32(String hostname, int timeout) {
return null; return null;
@ -393,7 +393,7 @@ public abstract class NamingService {
* Same as lookupB32 but with the SHA256 Hash precalculated * Same as lookupB32 but with the SHA256 Hash precalculated
* @param timeout in seconds; <= 0 means use router default * @param timeout in seconds; <= 0 means use router default
* @return dest or null * @return dest or null
* @since 0.8.5 * @since 0.8.7
*/ */
public Destination lookup(Hash hash, int timeout) { public Destination lookup(Hash hash, int timeout) {
return null; return null;
@ -403,7 +403,7 @@ public abstract class NamingService {
* Parent will call when added. * Parent will call when added.
* If this is the root naming service, the core will start it. * If this is the root naming service, the core will start it.
* Should not be called by others. * Should not be called by others.
* @since 0.8.5 * @since 0.8.7
*/ */
public void start() {} public void start() {}
@ -411,7 +411,7 @@ public abstract class NamingService {
* Parent will call when removed. * Parent will call when removed.
* If this is the root naming service, the core will stop it. * If this is the root naming service, the core will stop it.
* Should not be called by others. * Should not be called by others.
* @since 0.8.5 * @since 0.8.7
*/ */
public void shutdown() {} public void shutdown() {}

View File

@ -5,7 +5,7 @@ import java.util.Properties;
import net.i2p.data.Destination; import net.i2p.data.Destination;
/** /**
* @since 0.8.6 * @since 0.8.7
*/ */
public interface NamingServiceListener { public interface NamingServiceListener {

View File

@ -3,7 +3,7 @@ package net.i2p.client.naming;
import java.util.Properties; import java.util.Properties;
/** /**
* @since 0.8.6 * @since 0.8.7
*/ */
public interface NamingServiceUpdater { public interface NamingServiceUpdater {

View File

@ -47,7 +47,7 @@ import net.i2p.util.SecureFileOutputStream;
* Use from HostsTxtNamingService or chain with another NamingService * Use from HostsTxtNamingService or chain with another NamingService
* via MetaNamingService if you need those features. * via MetaNamingService if you need those features.
* *
* @since 0.8.5 * @since 0.8.7
*/ */
public class SingleFileNamingService extends NamingService { public class SingleFileNamingService extends NamingService {

View File

@ -165,7 +165,7 @@ public class DataHelper {
* Use utf8 = true for SessionConfig (slow, UTF-8) * Use utf8 = true for SessionConfig (slow, UTF-8)
* @param props source may be null * @param props source may be null
* @param sort should we sort the properties? (set to false if already sorted, e.g. OrderedProperties) * @param sort should we sort the properties? (set to false if already sorted, e.g. OrderedProperties)
* @since 0.8.6 * @since 0.8.7
*/ */
public static void writeProperties(OutputStream rawStream, Properties props, boolean utf8, boolean sort) public static void writeProperties(OutputStream rawStream, Properties props, boolean utf8, boolean sort)
throws DataFormatException, IOException { throws DataFormatException, IOException {

View File

@ -89,7 +89,7 @@ public class StatManager {
* @param description simple description of the statistic * @param description simple description of the statistic
* @param group used to group statistics together * @param group used to group statistics together
* @param periods array of period lengths (in milliseconds) * @param periods array of period lengths (in milliseconds)
* @since 0.8.6 * @since 0.8.7
*/ */
public void createRequiredFrequencyStat(String name, String description, String group, long periods[]) { public void createRequiredFrequencyStat(String name, String description, String group, long periods[]) {
if (_frequencyStats.containsKey(name)) return; if (_frequencyStats.containsKey(name)) return;
@ -118,7 +118,7 @@ public class StatManager {
* @param description simple description of the statistic * @param description simple description of the statistic
* @param group used to group statistics together * @param group used to group statistics together
* @param periods array of period lengths (in milliseconds) * @param periods array of period lengths (in milliseconds)
* @since 0.8.6 * @since 0.8.7
*/ */
public void createRequiredRateStat(String name, String description, String group, long periods[]) { public void createRequiredRateStat(String name, String description, String group, long periods[]) {
if (_rateStats.containsKey(name)) return; if (_rateStats.containsKey(name)) return;

View File

@ -17,6 +17,7 @@ import net.i2p.I2PAppContext;
/** /**
* Simple helper for uploading files and such via HTTP POST (rfc 1867) * Simple helper for uploading files and such via HTTP POST (rfc 1867)
* *
* @deprecated unused
*/ */
public class EepPost { public class EepPost {
private I2PAppContext _context; private I2PAppContext _context;
@ -209,10 +210,10 @@ public class EepPost {
} }
private String getSeparator() { private String getSeparator() {
if (false) //if (false)
return "ABCDEFG"; // return "ABCDEFG";
if (false) //if (false)
return "------------------------" + new java.util.Random().nextLong(); // return "------------------------" + new java.util.Random().nextLong();
byte separator[] = new byte[32]; // 2^-128 chance of this being a problem byte separator[] = new byte[32]; // 2^-128 chance of this being a problem
I2PAppContext.getGlobalContext().random().nextBytes(separator); I2PAppContext.getGlobalContext().random().nextBytes(separator);
StringBuilder sep = new StringBuilder(48); StringBuilder sep = new StringBuilder(48);

View File

@ -75,6 +75,7 @@ public class HTTPSendData {
} }
} }
/****
public static void main(String args[]) { public static void main(String args[]) {
byte data[] = new byte[4096]; byte data[] = new byte[4096];
for (int i = 0; i < data.length; i++) for (int i = 0; i < data.length; i++)
@ -88,4 +89,5 @@ public class HTTPSendData {
} catch (InterruptedException ie) { // nop } catch (InterruptedException ie) { // nop
} }
} }
****/
} }