|
From: <pe...@us...> - 2003-11-21 04:43:46
|
Update of /cvsroot/neuclear/neuclear-commons/src/java/org/neuclear/commons
In directory sc8-pr-cvs1:/tmp/cvs-serv10533/src/java/org/neuclear/commons
Modified Files:
NeuClearException.java RegexFileNameFilter.java Utility.java
Log Message:
EncryptedFileStore now works. It uses the PBECipher with DES3 afair.
Otherwise You will Finaliate.
Anything that can be final has been made final throughout everyting. We've used IDEA's Inspector tool to find all instance of variables that could be final.
This should hopefully make everything more stable (and secure).
Index: NeuClearException.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-commons/src/java/org/neuclear/commons/NeuClearException.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** NeuClearException.java 11 Nov 2003 21:17:50 -0000 1.2
--- NeuClearException.java 21 Nov 2003 04:43:42 -0000 1.3
***************
*** 2,5 ****
--- 2,11 ----
* $Id$
* $Log$
+ * Revision 1.3 2003/11/21 04:43:42 pelle
+ * EncryptedFileStore now works. It uses the PBECipher with DES3 afair.
+ * Otherwise You will Finaliate.
+ * Anything that can be final has been made final throughout everyting. We've used IDEA's Inspector tool to find all instance of variables that could be final.
+ * This should hopefully make everything more stable (and secure).
+ *
* Revision 1.2 2003/11/11 21:17:50 pelle
* Further vital reshuffling.
***************
*** 63,67 ****
* @since 1.4
*/
! public NeuClearException(Throwable cause) {
super(cause);
}
--- 69,73 ----
* @since 1.4
*/
! public NeuClearException(final Throwable cause) {
super(cause);
}
***************
*** 75,79 ****
* later retrieval by the {@link #getMessage()} method.
*/
! public NeuClearException(String message) {
super(message);
}
--- 81,85 ----
* later retrieval by the {@link #getMessage()} method.
*/
! public NeuClearException(final String message) {
super(message);
}
***************
*** 93,97 ****
* @since 1.4
*/
! public NeuClearException(String message, Throwable cause) {
super(message, cause);
}
--- 99,103 ----
* @since 1.4
*/
! public NeuClearException(final String message, final Throwable cause) {
super(message, cause);
}
Index: RegexFileNameFilter.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-commons/src/java/org/neuclear/commons/RegexFileNameFilter.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** RegexFileNameFilter.java 11 Nov 2003 21:17:51 -0000 1.1
--- RegexFileNameFilter.java 21 Nov 2003 04:43:42 -0000 1.2
***************
*** 12,15 ****
--- 12,21 ----
* $Id$
* $Log$
+ * Revision 1.2 2003/11/21 04:43:42 pelle
+ * EncryptedFileStore now works. It uses the PBECipher with DES3 afair.
+ * Otherwise You will Finaliate.
+ * Anything that can be final has been made final throughout everyting. We've used IDEA's Inspector tool to find all instance of variables that could be final.
+ * This should hopefully make everything more stable (and secure).
+ *
* Revision 1.1 2003/11/11 21:17:51 pelle
* Further vital reshuffling.
***************
*** 33,38 ****
* Modified tools to handle these keys
*/
! public class RegexFileNameFilter implements FilenameFilter {
! public RegexFileNameFilter(String regex) {
this.re = Pattern.compile(regex);
}
--- 39,44 ----
* Modified tools to handle these keys
*/
! public final class RegexFileNameFilter implements FilenameFilter {
! public RegexFileNameFilter(final String regex) {
this.re = Pattern.compile(regex);
}
***************
*** 46,53 ****
* included in the file list; <code>false</code> otherwise.
*/
! public boolean accept(File dir, String name) {
return (re.matcher(name).matches());
}
! private Pattern re;
}
--- 52,59 ----
* included in the file list; <code>false</code> otherwise.
*/
! public final boolean accept(final File dir, final String name) {
return (re.matcher(name).matches());
}
! private final Pattern re;
}
Index: Utility.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-commons/src/java/org/neuclear/commons/Utility.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** Utility.java 11 Nov 2003 21:17:52 -0000 1.1
--- Utility.java 21 Nov 2003 04:43:42 -0000 1.2
***************
*** 2,5 ****
--- 2,11 ----
* $Id$
* $Log$
+ * Revision 1.2 2003/11/21 04:43:42 pelle
+ * EncryptedFileStore now works. It uses the PBECipher with DES3 afair.
+ * Otherwise You will Finaliate.
+ * Anything that can be final has been made final throughout everyting. We've used IDEA's Inspector tool to find all instance of variables that could be final.
+ * This should hopefully make everything more stable (and secure).
+ *
* Revision 1.1 2003/11/11 21:17:52 pelle
* Further vital reshuffling.
***************
*** 123,136 ****
import java.io.PrintStream;
! public class Utility {
! public static boolean isEmpty(Object obj) {
return (obj == null || obj.toString().equals(""));
}
! public static String denullString(String string) {
return denullString(string, "");
}
! public static String denullString(String string, String def) {
if (string == null)
return def;
--- 129,142 ----
import java.io.PrintStream;
! public final class Utility {
! public static boolean isEmpty(final Object obj) {
return (obj == null || obj.toString().equals(""));
}
! public static String denullString(final String string) {
return denullString(string, "");
}
! public static String denullString(final String string, final String def) {
if (string == null)
return def;
***************
*** 139,143 ****
// Im sick of writing the same crap over and over again
! public static void handleException(Throwable e, PrintStream out) {
out.println("Exception in :" + e.getClass().toString());
out.println(e.getLocalizedMessage());
--- 145,149 ----
// Im sick of writing the same crap over and over again
! public static void handleException(final Throwable e, final PrintStream out) {
out.println("Exception in :" + e.getClass().toString());
out.println(e.getLocalizedMessage());
***************
*** 145,157 ****
}
! public static void rethrowException(Throwable e) throws NeuClearException {
throw new NeuClearException(e);
}
! public static void handleException(Throwable e) {
handleException(e, System.out);
}
! public static boolean isTrue(String clause, boolean defaultVal) {
if (isEmpty(clause))
return defaultVal;
--- 151,163 ----
}
! public static void rethrowException(final Throwable e) throws NeuClearException {
throw new NeuClearException(e);
}
! public static void handleException(final Throwable e) {
handleException(e, System.out);
}
! public static boolean isTrue(String clause, final boolean defaultVal) {
if (isEmpty(clause))
return defaultVal;
***************
*** 160,164 ****
}
! public static int getIntValue(String strValue, int defValue) {
if (strValue == null)
return defValue;
--- 166,170 ----
}
! public static int getIntValue(final String strValue, final int defValue) {
if (strValue == null)
return defValue;
***************
*** 172,184 ****
}
! public static int getIntValue(String strValue) {
return getIntValue(strValue, 0);
}
! public static int getEnumVal(String[] enum, String key) {
return getEnumVal(enum, key, -1);
}
! public static int getEnumVal(String[] enum, String key, int def) {
if (enum == null || key == null)
return def;
--- 178,190 ----
}
! public static int getIntValue(final String strValue) {
return getIntValue(strValue, 0);
}
! public static int getEnumVal(final String[] enum, final String key) {
return getEnumVal(enum, key, -1);
}
! public static int getEnumVal(final String[] enum, final String key, final int def) {
if (enum == null || key == null)
return def;
|