forked from I2P_Developers/i2p.i2p
javadoc fixes after review
This commit is contained in:
@ -365,12 +365,12 @@ public class SnarkManager implements CompleteListener {
|
|||||||
/**
|
/**
|
||||||
* Migrate the old flat config file to the new config dir
|
* Migrate the old flat config file to the new config dir
|
||||||
* containing the config file minus the per-torrent entries,
|
* containing the config file minus the per-torrent entries,
|
||||||
* the dht file, and 16 subdirs for per-torrent config files
|
* the dht file, and 64 subdirs for per-torrent config files
|
||||||
* Caller must synch.
|
* Caller must synch.
|
||||||
*
|
*
|
||||||
* @return the new config directory, non-null
|
* @return the new config directory, non-null
|
||||||
* @throws RuntimeException on creation fail
|
* @throws RuntimeException on creation fail
|
||||||
* @since 0.9.11
|
* @since 0.9.15
|
||||||
*/
|
*/
|
||||||
private File migrateConfig(File oldFile) {
|
private File migrateConfig(File oldFile) {
|
||||||
File dir = new SecureDirectory(oldFile + CONFIG_DIR_SUFFIX);
|
File dir = new SecureDirectory(oldFile + CONFIG_DIR_SUFFIX);
|
||||||
@ -478,7 +478,7 @@ public class SnarkManager implements CompleteListener {
|
|||||||
/**
|
/**
|
||||||
* The config for a torrent
|
* The config for a torrent
|
||||||
* @return non-null, possibly empty
|
* @return non-null, possibly empty
|
||||||
* @since 0.9.11
|
* @since 0.9.15
|
||||||
*/
|
*/
|
||||||
private Properties getConfig(Snark snark) {
|
private Properties getConfig(Snark snark) {
|
||||||
return getConfig(snark.getInfoHash());
|
return getConfig(snark.getInfoHash());
|
||||||
@ -488,7 +488,7 @@ public class SnarkManager implements CompleteListener {
|
|||||||
* The config for a torrent
|
* The config for a torrent
|
||||||
* @param ih 20-byte infohash
|
* @param ih 20-byte infohash
|
||||||
* @return non-null, possibly empty
|
* @return non-null, possibly empty
|
||||||
* @since 0.9.11
|
* @since 0.9.15
|
||||||
*/
|
*/
|
||||||
private Properties getConfig(byte[] ih) {
|
private Properties getConfig(byte[] ih) {
|
||||||
Properties rv = new OrderedProperties();
|
Properties rv = new OrderedProperties();
|
||||||
@ -505,7 +505,7 @@ public class SnarkManager implements CompleteListener {
|
|||||||
* The config file for a torrent
|
* The config file for a torrent
|
||||||
* @param confDir the config directory
|
* @param confDir the config directory
|
||||||
* @param ih 20-byte infohash
|
* @param ih 20-byte infohash
|
||||||
* @since 0.9.11
|
* @since 0.9.15
|
||||||
*/
|
*/
|
||||||
private static File configFile(File confDir, byte[] ih) {
|
private static File configFile(File confDir, byte[] ih) {
|
||||||
String hex = I2PSnarkUtil.toHex(ih);
|
String hex = I2PSnarkUtil.toHex(ih);
|
||||||
@ -1507,7 +1507,7 @@ public class SnarkManager implements CompleteListener {
|
|||||||
/**
|
/**
|
||||||
* Get the base location for a torrent from the config file.
|
* Get the base location for a torrent from the config file.
|
||||||
* @return File or null, doesn't necessarily exist
|
* @return File or null, doesn't necessarily exist
|
||||||
* @since 0.9.11
|
* @since 0.9.15
|
||||||
*/
|
*/
|
||||||
private File getSavedBaseFile(byte[] ih) {
|
private File getSavedBaseFile(byte[] ih) {
|
||||||
Properties config = getConfig(ih);
|
Properties config = getConfig(ih);
|
||||||
|
@ -744,7 +744,7 @@ public class Storage
|
|||||||
/**
|
/**
|
||||||
* The base file or directory.
|
* The base file or directory.
|
||||||
* @return the File
|
* @return the File
|
||||||
* @since 0.9.11
|
* @since 0.9.15
|
||||||
*/
|
*/
|
||||||
public File getBase() {
|
public File getBase() {
|
||||||
return _base;
|
return _base;
|
||||||
@ -753,7 +753,7 @@ public class Storage
|
|||||||
/**
|
/**
|
||||||
* Does not include directories. Unsorted.
|
* Does not include directories. Unsorted.
|
||||||
* @return a new List
|
* @return a new List
|
||||||
* @since 0.9.11
|
* @since 0.9.15
|
||||||
*/
|
*/
|
||||||
public List<File> getFiles() {
|
public List<File> getFiles() {
|
||||||
List<File> rv = new ArrayList<File>(_torrentFiles.size());
|
List<File> rv = new ArrayList<File>(_torrentFiles.size());
|
||||||
@ -767,8 +767,8 @@ public class Storage
|
|||||||
* Includes the base for a multi-file torrent.
|
* Includes the base for a multi-file torrent.
|
||||||
* Sorted bottom-up for easy deletion.
|
* Sorted bottom-up for easy deletion.
|
||||||
* Slow. Use for deletion only.
|
* Slow. Use for deletion only.
|
||||||
* @since 0.9.11
|
|
||||||
* @return a new Set or null for a single-file torrent
|
* @return a new Set or null for a single-file torrent
|
||||||
|
* @since 0.9.15
|
||||||
*/
|
*/
|
||||||
public SortedSet<File> getDirectories() {
|
public SortedSet<File> getDirectories() {
|
||||||
if (!_base.isDirectory())
|
if (!_base.isDirectory())
|
||||||
|
@ -212,6 +212,7 @@ public class SigUtil {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @return JAVA EdDSA public key!
|
* @return JAVA EdDSA public key!
|
||||||
|
* @since 0.9.15
|
||||||
*/
|
*/
|
||||||
public static EdDSAPublicKey toJavaEdDSAKey(SigningPublicKey pk)
|
public static EdDSAPublicKey toJavaEdDSAKey(SigningPublicKey pk)
|
||||||
throws GeneralSecurityException {
|
throws GeneralSecurityException {
|
||||||
@ -230,6 +231,7 @@ public class SigUtil {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @return JAVA EdDSA private key!
|
* @return JAVA EdDSA private key!
|
||||||
|
* @since 0.9.15
|
||||||
*/
|
*/
|
||||||
public static EdDSAPrivateKey toJavaEdDSAKey(SigningPrivateKey pk)
|
public static EdDSAPrivateKey toJavaEdDSAKey(SigningPrivateKey pk)
|
||||||
throws GeneralSecurityException {
|
throws GeneralSecurityException {
|
||||||
@ -246,6 +248,9 @@ public class SigUtil {
|
|||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @since 0.9.15
|
||||||
|
*/
|
||||||
private static EdDSAPublicKey cvtToJavaEdDSAKey(SigningPublicKey pk)
|
private static EdDSAPublicKey cvtToJavaEdDSAKey(SigningPublicKey pk)
|
||||||
throws GeneralSecurityException {
|
throws GeneralSecurityException {
|
||||||
try {
|
try {
|
||||||
@ -256,6 +261,9 @@ public class SigUtil {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @since 0.9.15
|
||||||
|
*/
|
||||||
private static EdDSAPrivateKey cvtToJavaEdDSAKey(SigningPrivateKey pk)
|
private static EdDSAPrivateKey cvtToJavaEdDSAKey(SigningPrivateKey pk)
|
||||||
throws GeneralSecurityException {
|
throws GeneralSecurityException {
|
||||||
try {
|
try {
|
||||||
@ -266,11 +274,17 @@ public class SigUtil {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @since 0.9.15
|
||||||
|
*/
|
||||||
public static SigningPublicKey fromJavaKey(EdDSAPublicKey pk, SigType type)
|
public static SigningPublicKey fromJavaKey(EdDSAPublicKey pk, SigType type)
|
||||||
throws GeneralSecurityException {
|
throws GeneralSecurityException {
|
||||||
return new SigningPublicKey(type, pk.getAbyte());
|
return new SigningPublicKey(type, pk.getAbyte());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @since 0.9.15
|
||||||
|
*/
|
||||||
public static SigningPrivateKey fromJavaKey(EdDSAPrivateKey pk, SigType type)
|
public static SigningPrivateKey fromJavaKey(EdDSAPrivateKey pk, SigType type)
|
||||||
throws GeneralSecurityException {
|
throws GeneralSecurityException {
|
||||||
return new SigningPrivateKey(type, pk.getSeed());
|
return new SigningPrivateKey(type, pk.getSeed());
|
||||||
|
Reference in New Issue
Block a user