Javadoc fixes in imagegen, sam, crypto

package.html files for imagegen
This commit is contained in:
zzz
2016-02-13 15:17:41 +00:00
parent 6ab5b84979
commit 071769679d
11 changed files with 35 additions and 15 deletions

View File

@ -7,7 +7,7 @@ import java.security.MessageDigest;
* Utility methods useful for implementing identicon functionality. Methods are * Utility methods useful for implementing identicon functionality. Methods are
* class methods for convenience. * class methods for convenience.
* <p> * <p>
* Key method of interest is {@link getIdenticonCode} which converts IP address * Key method of interest is {@link #getIdenticonCode} which converts IP address
* into identicon code.<br> * into identicon code.<br>
* <strong>IMPORTANT</strong>: <code>inetSalt</code> value must be set to * <strong>IMPORTANT</strong>: <code>inetSalt</code> value must be set to
* reasonably long random string prior to invoking this method. * reasonably long random string prior to invoking this method.
@ -49,7 +49,7 @@ public class IdenticonUtil {
/** /**
* Returns current inetSalt value. * Returns current inetSalt value.
* *
* @return * @return the value
*/ */
public static String getInetSalt() { public static String getInetSalt() {
return inetSalt; return inetSalt;
@ -117,7 +117,7 @@ public class IdenticonUtil {
* will be used to determine the value. * will be used to determine the value.
* @param remoteAddr * @param remoteAddr
* HTTP requester's IP address. Optional if code was specified. * HTTP requester's IP address. Optional if code was specified.
* @return * @return the code
*/ */
public static int getIdenticonCode(String codeParam, String remoteAddr) { public static int getIdenticonCode(String codeParam, String remoteAddr) {
int code = 0; int code = 0;

View File

@ -100,7 +100,7 @@ public class NineBlockIdenticonRenderer2 implements IdenticonRenderer {
* Returns the size in pixels at which each patch will be rendered before * Returns the size in pixels at which each patch will be rendered before
* they are scaled down to requested identicon size. * they are scaled down to requested identicon size.
* *
* @return * @return the size
*/ */
public float getPatchSize() { public float getPatchSize() {
return patchSize; return patchSize;
@ -161,7 +161,7 @@ public class NineBlockIdenticonRenderer2 implements IdenticonRenderer {
* *
* <p> * <p>
* Size of the returned identicon image is determined by patchSize set using * Size of the returned identicon image is determined by patchSize set using
* {@link setPatchSize}. Since a 9-block identicon consists of 3x3 patches, * {@link #setPatchSize}. Since a 9-block identicon consists of 3x3 patches,
* width and height will be 3 times the patch size. * width and height will be 3 times the patch size.
* </p> * </p>
* *
@ -304,7 +304,7 @@ public class NineBlockIdenticonRenderer2 implements IdenticonRenderer {
* *
* @param c1 * @param c1
* @param c2 * @param c2
* @return * @return the distance
*/ */
private float getColorDistance(Color c1, Color c2) { private float getColorDistance(Color c1, Color c2) {
float dx = c1.getRed() - c2.getRed(); float dx = c1.getRed() - c2.getRed();
@ -317,7 +317,7 @@ public class NineBlockIdenticonRenderer2 implements IdenticonRenderer {
* Returns complementary color. * Returns complementary color.
* *
* @param color * @param color
* @return * @return the complement
*/ */
private Color getComplementaryColor(Color color) { private Color getComplementaryColor(Color color) {
return new Color(color.getRGB() ^ 0x00FFFFFF); return new Color(color.getRGB() ^ 0x00FFFFFF);

View File

@ -0,0 +1,11 @@
<html>
<body>
<p>
The main identicon code is here.
The servlet is in net.i2p.imagegen.
There are minor modifications to remove dependencies on commons-logging
and the org.cache2k package.
From https://github.com/PauloMigAlmeida/identicon
</p>
</body>
</html>

View File

@ -87,7 +87,7 @@ public class IdenticonServlet extends HttpServlet {
String cacheProvider = cfg.getInitParameter(INIT_PARAM_CACHE_PROVIDER); String cacheProvider = cfg.getInitParameter(INIT_PARAM_CACHE_PROVIDER);
if (cacheProvider != null) { if (cacheProvider != null) {
try { try {
Class cacheClass = Class.forName(cacheProvider); Class<?> cacheClass = Class.forName(cacheProvider);
this.cache = (IdenticonCache) cacheClass.newInstance(); this.cache = (IdenticonCache) cacheClass.newInstance();
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();

View File

@ -54,7 +54,7 @@ public class QRServlet extends HttpServlet {
String cacheProvider = cfg.getInitParameter(INIT_PARAM_CACHE_PROVIDER); String cacheProvider = cfg.getInitParameter(INIT_PARAM_CACHE_PROVIDER);
if (cacheProvider != null) { if (cacheProvider != null) {
try { try {
Class cacheClass = Class.forName(cacheProvider); Class<?> cacheClass = Class.forName(cacheProvider);
this.cache = (IdenticonCache) cacheClass.newInstance(); this.cache = (IdenticonCache) cacheClass.newInstance();
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();

View File

@ -0,0 +1,7 @@
<html>
<body>
<p>
Servlets for generating QR codes and identicon images.
</p>
</body>
</html>

View File

@ -0,0 +1,7 @@
<html>
<body>
<p>
This is a small portion of zxing, including only what's required to generate QR codes.
</p>
</body>
</html>

View File

@ -78,8 +78,6 @@ abstract class SAMMessageSession implements SAMMessageSess {
/** /**
* Initialize a new SAM message-based session using an existing I2PSession. * Initialize a new SAM message-based session using an existing I2PSession.
* *
* @param destStream Input stream containing the destination and private keys (same format as PrivateKeyFile)
* @param props Properties to setup the I2P session
* @throws IOException * @throws IOException
* @throws DataFormatException * @throws DataFormatException
* @throws I2PSessionException * @throws I2PSessionException

View File

@ -946,7 +946,6 @@ class SAMv1Handler extends SAMHandler implements SAMRawReceiver, SAMDatagramRece
* Writes s + createMessageString(msg) + \n * Writes s + createMessageString(msg) + \n
* *
* @param s The string, non-null * @param s The string, non-null
* @param s The message may be null
* @since 0.9.25 * @since 0.9.25
*/ */
protected boolean writeString(String s, String msg) { protected boolean writeString(String s, String msg) {

View File

@ -95,7 +95,7 @@ class SAMv3StreamSession extends SAMStreamSession implements Session
* *
* Caller MUST call start(). * Caller MUST call start().
* *
* @param nick nickname of the session * @param login nickname of the session
* @throws IOException * @throws IOException
* @throws DataFormatException * @throws DataFormatException
* @throws I2PSessionException * @throws I2PSessionException

View File

@ -541,8 +541,6 @@ public final class KeyStoreUtil {
* @param cname e.g. randomstuff.console.i2p.net * @param cname e.g. randomstuff.console.i2p.net
* @param ou e.g. console * @param ou e.g. console
* @param validDays e.g. 3652 (10 years) * @param validDays e.g. 3652 (10 years)
* @param keyAlg e.g. DSA , RSA, EC
* @param keySize e.g. 1024
* @param keyPW the key password, must be at least 6 characters * @param keyPW the key password, must be at least 6 characters
* @return all you need: * @return all you need:
* rv[0] is a Java PublicKey * rv[0] is a Java PublicKey