diff --git a/binaries/jars/latest_development/intrace-agent.jar b/binaries/jars/latest_development/intrace-agent.jar
index c74e85d..a9bc0a5 100644
Binary files a/binaries/jars/latest_development/intrace-agent.jar and b/binaries/jars/latest_development/intrace-agent.jar differ
diff --git a/binaries/jars/latest_development/intrace-ui.jar b/binaries/jars/latest_development/intrace-ui.jar
index d630bfd..548db2c 100644
Binary files a/binaries/jars/latest_development/intrace-ui.jar and b/binaries/jars/latest_development/intrace-ui.jar differ
diff --git a/intrace.appengine/war/features/intrace.ecl.feature_0.20.0.jar b/intrace.appengine/war/features/intrace.ecl.feature_0.20.0.jar
deleted file mode 100644
index 0245062..0000000
Binary files a/intrace.appengine/war/features/intrace.ecl.feature_0.20.0.jar and /dev/null differ
diff --git a/intrace.appengine/war/plugins/intrace.ecl_0.20.0.jar b/intrace.appengine/war/plugins/intrace.ecl_0.20.0.jar
deleted file mode 100644
index fe8d0aa..0000000
Binary files a/intrace.appengine/war/plugins/intrace.ecl_0.20.0.jar and /dev/null differ
diff --git a/intrace.ecl.feature/feature.xml b/intrace.ecl.feature/feature.xml
index 911c819..e33395f 100644
--- a/intrace.ecl.feature/feature.xml
+++ b/intrace.ecl.feature/feature.xml
@@ -2,7 +2,7 @@
Encodes and decodes to and from Base64 notation. Homepage: http://iharder.net/base64. Example: The options parameter, which appears in a few places, is used to pass
- * several pieces of information to the encoder. In the "higher level" methods such as
- * encodeBytes( bytes, options ) the options parameter can be used to indicate such
+ * The options parameter, which appears in a few places, is used to pass
+ * several pieces of information to the encoder. In the "higher level" methods such as
+ * encodeBytes( bytes, options ) the options parameter can be used to indicate such
* things as first gzipping the bytes before encoding them, not inserting linefeeds,
* and encoding using the URL-safe and Ordered dialects.String encoded = Base64.encode( myByteArray );
*
* byte[] myByteArray = Base64.decode( encoded );
*
- *
The constants defined in Base64 can be OR-ed together to combine options, so you + *
The constants defined in Base64 can be OR-ed together to combine options, so you * might make a call like this:
* *String encoded = Base64.encodeBytes( mybytes, Base64.GZIP | Base64.DO_BREAK_LINES );
@@ -67,7 +67,7 @@ package org.intrace.shared;
* Encodes up to three bytes of the array source * and writes the resulting four Base64 bytes to destination. * The source and destination arrays can be manipulated - * anywhere along their length by specifying + * anywhere along their length by specifying * srcOffset and destOffset. * This method does not check to make sure your arrays * are large enough to accomodate srcOffset + 3 for @@ -491,19 +491,19 @@ public class Base64 * @return the destination array * @since 1.3 */ - private static byte[] encode3to4( + private static byte[] encode3to4( byte[] source, int srcOffset, int numSigBytes, byte[] destination, int destOffset, int options ) { - - byte[] ALPHABET = getAlphabet( options ); - - // 1 2 3 + + byte[] ALPHABET = getAlphabet( options ); + + // 1 2 3 // 01234567890123456789012345678901 Bit position // --------000000001111111122222222 Array position from threeBytes // --------| || || || | Six bit groups to index ALPHABET // >>18 >>12 >> 6 >> 0 Right shift necessary // 0x3f 0x3f 0x3f Additional AND - + // Create buffer with zero-padding if there are only one or two // significant bytes passed in the array. // We have to shift left 24 in order to flush out the 1's that appear @@ -520,21 +520,21 @@ public class Base64 destination[ destOffset + 2 ] = ALPHABET[ (inBuff >>> 6) & 0x3f ]; destination[ destOffset + 3 ] = ALPHABET[ (inBuff ) & 0x3f ]; return destination; - + case 2: destination[ destOffset ] = ALPHABET[ (inBuff >>> 18) ]; destination[ destOffset + 1 ] = ALPHABET[ (inBuff >>> 12) & 0x3f ]; destination[ destOffset + 2 ] = ALPHABET[ (inBuff >>> 6) & 0x3f ]; destination[ destOffset + 3 ] = EQUALS_SIGN; return destination; - + case 1: destination[ destOffset ] = ALPHABET[ (inBuff >>> 18) ]; destination[ destOffset + 1 ] = ALPHABET[ (inBuff >>> 12) & 0x3f ]; destination[ destOffset + 2 ] = EQUALS_SIGN; destination[ destOffset + 3 ] = EQUALS_SIGN; return destination; - + default: return destination; } // end switch @@ -592,18 +592,18 @@ public class Base64 } - - + + /** * Serializes an object and returns the Base64-encoded - * version of that serialized object. - * + * version of that serialized object. + * *
As of v 2.3, if the object * cannot be serialized or there is another error, * the method will throw an java.io.IOException. This is new to v2.3! * In earlier versions, it just returned a null value, but * in retrospect that's a pretty poor way to handle it.
- * + * * The object is not GZip-compressed before being encoded. * * @param serializableObject The object to encode @@ -616,19 +616,19 @@ public class Base64 throws java.io.IOException { return encodeObject( serializableObject, NO_OPTIONS ); } // end encodeObject - + /** * Serializes an object and returns the Base64-encoded * version of that serialized object. - * + * *As of v 2.3, if the object * cannot be serialized or there is another error, * the method will throw an java.io.IOException. This is new to v2.3! * In earlier versions, it just returned a null value, but * in retrospect that's a pretty poor way to handle it.
- * + * * The object is not GZip-compressed before being encoded. ** Example options:
@@ -654,14 +654,14 @@ public class Base64
if( serializableObject == null ){
throw new NullPointerException( "Cannot serialize a null object." );
} // end if: null
-
+
// Streams
- java.io.ByteArrayOutputStream baos = null;
+ java.io.ByteArrayOutputStream baos = null;
java.io.OutputStream b64os = null;
java.util.zip.GZIPOutputStream gzos = null;
java.io.ObjectOutputStream oos = null;
-
-
+
+
try {
// ObjectOutputStream -> (GZIP) -> Base64 -> ByteArrayOutputStream
baos = new java.io.ByteArrayOutputStream();
@@ -687,7 +687,7 @@ public class Base64
try{ b64os.close(); } catch( Exception e ){}
try{ baos.close(); } catch( Exception e ){}
} // end finally
-
+
// Return value according to relevant encoding.
try {
return new String( baos.toByteArray(), PREFERRED_ENCODING );
@@ -696,15 +696,15 @@ public class Base64
// Fall back to some Java default
return new String( baos.toByteArray() );
} // end catch
-
+
} // end encode
-
-
+
+
/**
* Encodes a byte array into Base64 notation.
* Does not GZip-compress data.
- *
+ *
* @param source The data to convert
* @return The data in Base64-encoded form
* @throws NullPointerException if source array is null
@@ -723,7 +723,7 @@ public class Base64
assert encoded != null;
return encoded;
} // end encodeBytes
-
+
/**
@@ -739,12 +739,12 @@ public class Base64
*
* Example: encodeBytes( myData, Base64.GZIP | Base64.DO_BREAK_LINES )
*
- *
+ *
*
As of v 2.3, if there is an error with the GZIP stream,
* the method will throw an java.io.IOException. This is new to v2.3!
* In earlier versions, it just returned a null value, but
* in retrospect that's a pretty poor way to handle it.
- *
+ *
*
* @param source The data to convert
* @param options Specified options
@@ -758,17 +758,17 @@ public class Base64
public static String encodeBytes( byte[] source, int options ) throws java.io.IOException {
return encodeBytes( source, 0, source.length, options );
} // end encodeBytes
-
-
+
+
/**
* Encodes a byte array into Base64 notation.
* Does not GZip-compress data.
- *
+ *
* As of v 2.3, if there is an error,
* the method will throw an java.io.IOException. This is new to v2.3!
* In earlier versions, it just returned a null value, but
* in retrospect that's a pretty poor way to handle it.
- *
+ *
*
* @param source The data to convert
* @param off Offset in array where conversion should begin
@@ -791,8 +791,8 @@ public class Base64
assert encoded != null;
return encoded;
} // end encodeBytes
-
-
+
+
/**
* Encodes a byte array into Base64 notation.
@@ -807,12 +807,12 @@ public class Base64
*
* Example: encodeBytes( myData, Base64.GZIP | Base64.DO_BREAK_LINES )
*
- *
+ *
*
As of v 2.3, if there is an error with the GZIP stream,
* the method will throw an java.io.IOException. This is new to v2.3!
* In earlier versions, it just returned a null value, but
* in retrospect that's a pretty poor way to handle it.
- *
+ *
*
* @param source The data to convert
* @param off Offset in array where conversion should begin
@@ -836,7 +836,7 @@ public class Base64
catch (java.io.UnsupportedEncodingException uue) {
return new String( encoded );
} // end catch
-
+
} // end encodeBytes
@@ -986,34 +986,34 @@ public class Base64
//System.err.println("No need to resize array.");
return outBuff;
}
-
+
} // end else: don't compress
} // end encodeBytesToBytes
-
-
-
-
+
+
+
+
/* ******** D E C O D I N G M E T H O D S ******** */
-
-
+
+
/**
* Decodes four bytes from array source
* and writes the resulting bytes (up to three of them)
* to destination.
* The source and destination arrays can be manipulated
- * anywhere along their length by specifying
+ * anywhere along their length by specifying
* srcOffset and destOffset.
* This method does not check to make sure your arrays
* are large enough to accomodate srcOffset + 4 for
* the source array or destOffset + 3 for
* the destination array.
- * This method returns the actual number of bytes that
+ * This method returns the actual number of bytes that
* were converted from the Base64 encoding.
* This is the lowest level of the decoding methods with
* all possible parameters.
- *
+ *
*
* @param source the array to convert
* @param srcOffset the index where conversion begins
@@ -1026,10 +1026,10 @@ public class Base64
* or there is not enough room in the array.
* @since 1.3
*/
- private static int decode4to3(
- byte[] source, int srcOffset,
+ private static int decode4to3(
+ byte[] source, int srcOffset,
byte[] destination, int destOffset, int options ) {
-
+
// Lots of error checking and exception throwing
if( source == null ){
throw new NullPointerException( "Source array was null." );
@@ -1045,10 +1045,10 @@ public class Base64
throw new IllegalArgumentException( String.format(
"Destination array with length %d cannot have offset of %d and still store three bytes.", destination.length, destOffset ) );
} // end if
-
-
- byte[] DECODABET = getDecodabet( options );
-
+
+
+ byte[] DECODABET = getDecodabet( options );
+
// Example: Dk==
if( source[ srcOffset + 2] == EQUALS_SIGN ) {
// Two ways to do the same thing. Don't know which way I like best.
@@ -1056,11 +1056,11 @@ public class Base64
// | ( ( DECODABET[ source[ srcOffset + 1] ] << 24 ) >>> 12 );
int outBuff = ( ( DECODABET[ source[ srcOffset ] ] & 0xFF ) << 18 )
| ( ( DECODABET[ source[ srcOffset + 1] ] & 0xFF ) << 12 );
-
+
destination[ destOffset ] = (byte)( outBuff >>> 16 );
return 1;
}
-
+
// Example: DkL=
else if( source[ srcOffset + 3 ] == EQUALS_SIGN ) {
// Two ways to do the same thing. Don't know which way I like best.
@@ -1070,12 +1070,12 @@ public class Base64
int outBuff = ( ( DECODABET[ source[ srcOffset ] ] & 0xFF ) << 18 )
| ( ( DECODABET[ source[ srcOffset + 1 ] ] & 0xFF ) << 12 )
| ( ( DECODABET[ source[ srcOffset + 2 ] ] & 0xFF ) << 6 );
-
+
destination[ destOffset ] = (byte)( outBuff >>> 16 );
destination[ destOffset + 1 ] = (byte)( outBuff >>> 8 );
return 2;
}
-
+
// Example: DkLE
else {
// Two ways to do the same thing. Don't know which way I like best.
@@ -1088,7 +1088,7 @@ public class Base64
| ( ( DECODABET[ source[ srcOffset + 2 ] ] & 0xFF ) << 6)
| ( ( DECODABET[ source[ srcOffset + 3 ] ] & 0xFF ) );
-
+
destination[ destOffset ] = (byte)( outBuff >> 16 );
destination[ destOffset + 1 ] = (byte)( outBuff >> 8 );
destination[ destOffset + 2 ] = (byte)( outBuff );
@@ -1096,7 +1096,7 @@ public class Base64
return 3;
}
} // end decodeToBytes
-
+
@@ -1125,8 +1125,8 @@ public class Base64
return decoded;
}
-
-
+
+
/**
* Low-level access to decoding ASCII characters in
* the form of a byte array. Ignores GUNZIP option, if
@@ -1146,7 +1146,7 @@ public class Base64
*/
public static byte[] decode( byte[] source, int off, int len, int options )
throws java.io.IOException {
-
+
// Lots of error checking and exception throwing
if( source == null ){
throw new NullPointerException( "Cannot decode null source array." );
@@ -1155,29 +1155,29 @@ public class Base64
throw new IllegalArgumentException( String.format(
"Source array with length %d cannot have offset of %d and process %d bytes.", source.length, off, len ) );
} // end if
-
+
if( len == 0 ){
return new byte[0];
}else if( len < 4 ){
- throw new IllegalArgumentException(
+ throw new IllegalArgumentException(
"Base64-encoded string must have at least four characters, but length specified was " + len );
} // end if
-
+
byte[] DECODABET = getDecodabet( options );
-
+
int len34 = len * 3 / 4; // Estimate on array size
byte[] outBuff = new byte[ len34 ]; // Upper limit on size of output
int outBuffPosn = 0; // Keep track of where we're writing
-
+
byte[] b4 = new byte[4]; // Four byte buffer from source, eliminating white space
int b4Posn = 0; // Keep track of four byte input buffer
int i = 0; // Source array counter
byte sbiDecode = 0; // Special value from DECODABET
-
+
for( i = off; i < off+len; i++ ) { // Loop through source
-
+
sbiDecode = DECODABET[ source[i]&0xFF ];
-
+
// White space, Equals sign, or legit Base64 character
// Note the values such as -5 and -9 in the
// DECODABETs at the top of the file.
@@ -1187,7 +1187,7 @@ public class Base64
if( b4Posn > 3 ) { // Time to decode?
outBuffPosn += decode4to3( b4, 0, outBuff, outBuffPosn, options );
b4Posn = 0;
-
+
// If that was the equals sign, break out of 'for' loop
if( source[i] == EQUALS_SIGN ) {
break;
@@ -1198,18 +1198,18 @@ public class Base64
else {
// There's a bad input character in the Base64 stream.
throw new java.io.IOException( String.format(
- "Bad Base64 input character decimal %d in array position %d", ((int)source[i])&0xFF, i ) );
- } // end else:
+ "Bad Base64 input character decimal %d in array position %d", source[i]&0xFF, i ) );
+ } // end else:
} // each input character
-
+
byte[] out = new byte[ outBuffPosn ];
- System.arraycopy( outBuff, 0, out, 0, outBuffPosn );
+ System.arraycopy( outBuff, 0, out, 0, outBuffPosn );
return out;
} // end decode
-
-
-
-
+
+
+
+
/**
* Decodes data from Base64 notation, automatically
* detecting gzip-compressed data and decompressing it.
@@ -1223,8 +1223,8 @@ public class Base64
return decode( s, NO_OPTIONS );
}
-
-
+
+
/**
* Decodes data from Base64 notation, automatically
* detecting gzip-compressed data and decompressing it.
@@ -1237,11 +1237,11 @@ public class Base64
* @since 1.4
*/
public static byte[] decode( String s, int options ) throws java.io.IOException {
-
+
if( s == null ){
throw new NullPointerException( "Input string was null." );
} // end if
-
+
byte[] bytes;
try {
bytes = s.getBytes( PREFERRED_ENCODING );
@@ -1250,16 +1250,16 @@ public class Base64
bytes = s.getBytes();
} // end catch
//
-
+
// Decode
bytes = decode( bytes, 0, bytes.length, options );
-
+
// Check to see if it's gzip-compressed
// GZIP Magic Two-Byte Number: 0x8b1f (35615)
boolean dontGunzip = (options & DONT_GUNZIP) != 0;
if( (bytes != null) && (bytes.length >= 4) && (!dontGunzip) ) {
-
- int head = ((int)bytes[0] & 0xff) | ((bytes[1] << 8) & 0xff00);
+
+ int head = (bytes[0] & 0xff) | ((bytes[1] << 8) & 0xff00);
if( java.util.zip.GZIPInputStream.GZIP_MAGIC == head ) {
java.io.ByteArrayInputStream bais = null;
java.util.zip.GZIPInputStream gzis = null;
@@ -1292,7 +1292,7 @@ public class Base64
} // end if: gzipped
} // end if: bytes.length >= 2
-
+
return bytes;
} // end decode
@@ -1314,7 +1314,7 @@ public class Base64
throws java.io.IOException, java.lang.ClassNotFoundException {
return decodeToObject(encodedObject,NO_OPTIONS,null);
}
-
+
/**
* Attempts to decode Base64 data and deserialize a Java
@@ -1328,21 +1328,21 @@ public class Base64
* @return The decoded and deserialized object
* @throws NullPointerException if encodedObject is null
* @throws java.io.IOException if there is a general error
- * @throws ClassNotFoundException if the decoded object is of a
+ * @throws ClassNotFoundException if the decoded object is of a
* class that cannot be found by the JVM
* @since 2.3.4
*/
- public static Object decodeToObject(
+ public static Object decodeToObject(
String encodedObject, int options, final ClassLoader loader )
throws java.io.IOException, java.lang.ClassNotFoundException {
-
+
// Decode and gunzip if necessary
byte[] objBytes = decode( encodedObject, options );
-
+
java.io.ByteArrayInputStream bais = null;
java.io.ObjectInputStream ois = null;
Object obj = null;
-
+
try {
bais = new java.io.ByteArrayInputStream( objBytes );
@@ -1358,7 +1358,7 @@ public class Base64
@Override
public Class> resolveClass(java.io.ObjectStreamClass streamClass)
throws java.io.IOException, ClassNotFoundException {
- Class c = Class.forName(streamClass.getName(), false, loader);
+ Class> c = Class.forName(streamClass.getName(), false, loader);
if( c == null ){
return super.resolveClass(streamClass);
} else {
@@ -1367,7 +1367,7 @@ public class Base64
} // end resolveClass
}; // end ois
} // end else: no custom class loader
-
+
obj = ois.readObject();
} // end try
catch( java.io.IOException e ) {
@@ -1380,12 +1380,12 @@ public class Base64
try{ bais.close(); } catch( Exception e ){}
try{ ois.close(); } catch( Exception e ){}
} // end finally
-
+
return obj;
} // end decodeObject
-
-
-
+
+
+
/**
* Convenience method for encoding data to a file.
*
@@ -1393,7 +1393,7 @@ public class Base64
* the method will throw an java.io.IOException. This is new to v2.3!
* In earlier versions, it just returned false, but
* in retrospect that's a pretty poor way to handle it.
- *
+ *
* @param dataToEncode byte array of data to encode in base64 form
* @param filename Filename for saving encoded data
* @throws java.io.IOException if there is an error
@@ -1402,14 +1402,14 @@ public class Base64
*/
public static void encodeToFile( byte[] dataToEncode, String filename )
throws java.io.IOException {
-
+
if( dataToEncode == null ){
throw new NullPointerException( "Data to encode was null." );
} // end iff
-
+
Base64.OutputStream bos = null;
try {
- bos = new Base64.OutputStream(
+ bos = new Base64.OutputStream(
new java.io.FileOutputStream( filename ), Base64.ENCODE );
bos.write( dataToEncode );
} // end try
@@ -1419,10 +1419,10 @@ public class Base64
finally {
try{ bos.close(); } catch( Exception e ){}
} // end finally
-
+
} // end encodeToFile
-
-
+
+
/**
* Convenience method for decoding data to a file.
*
@@ -1430,7 +1430,7 @@ public class Base64
* the method will throw an java.io.IOException. This is new to v2.3!
* In earlier versions, it just returned false, but
* in retrospect that's a pretty poor way to handle it.
- *
+ *
* @param dataToDecode Base64-encoded data as a string
* @param filename Filename for saving decoded data
* @throws java.io.IOException if there is an error
@@ -1438,10 +1438,10 @@ public class Base64
*/
public static void decodeToFile( String dataToDecode, String filename )
throws java.io.IOException {
-
+
Base64.OutputStream bos = null;
try{
- bos = new Base64.OutputStream(
+ bos = new Base64.OutputStream(
new java.io.FileOutputStream( filename ), Base64.DECODE );
bos.write( dataToDecode.getBytes( PREFERRED_ENCODING ) );
} // end try
@@ -1451,12 +1451,12 @@ public class Base64
finally {
try{ bos.close(); } catch( Exception e ){}
} // end finally
-
+
} // end decodeToFile
-
-
-
-
+
+
+
+
/**
* Convenience method for reading a base64-encoded
* file and decoding it.
@@ -1465,7 +1465,7 @@ public class Base64
* the method will throw an java.io.IOException. This is new to v2.3!
* In earlier versions, it just returned false, but
* in retrospect that's a pretty poor way to handle it.
- *
+ *
* @param filename Filename for reading encoded data
* @return decoded byte array
* @throws java.io.IOException if there is an error
@@ -1473,7 +1473,7 @@ public class Base64
*/
public static byte[] decodeFromFile( String filename )
throws java.io.IOException {
-
+
byte[] decodedData = null;
Base64.InputStream bis = null;
try
@@ -1483,28 +1483,28 @@ public class Base64
byte[] buffer = null;
int length = 0;
int numBytes = 0;
-
+
// Check for size of file
if( file.length() > Integer.MAX_VALUE )
{
throw new java.io.IOException( "File is too big for this convenience method (" + file.length() + " bytes)." );
} // end if: file too big for int index
buffer = new byte[ (int)file.length() ];
-
+
// Open a stream
- bis = new Base64.InputStream(
- new java.io.BufferedInputStream(
+ bis = new Base64.InputStream(
+ new java.io.BufferedInputStream(
new java.io.FileInputStream( file ) ), Base64.DECODE );
-
+
// Read until done
while( ( numBytes = bis.read( buffer, length, 4096 ) ) >= 0 ) {
length += numBytes;
} // end while
-
+
// Save in a variable to return
decodedData = new byte[ length ];
System.arraycopy( buffer, 0, decodedData, 0, length );
-
+
} // end try
catch( java.io.IOException e ) {
throw e; // Catch and release to execute finally{}
@@ -1512,12 +1512,12 @@ public class Base64
finally {
try{ bis.close(); } catch( Exception e) {}
} // end finally
-
+
return decodedData;
} // end decodeFromFile
-
-
-
+
+
+
/**
* Convenience method for reading a binary file
* and base64-encoding it.
@@ -1526,7 +1526,7 @@ public class Base64
* the method will throw an java.io.IOException. This is new to v2.3!
* In earlier versions, it just returned false, but
* in retrospect that's a pretty poor way to handle it.
- *
+ *
* @param filename Filename for reading binary data
* @return base64-encoded string
* @throws java.io.IOException if there is an error
@@ -1534,7 +1534,7 @@ public class Base64
*/
public static String encodeFromFile( String filename )
throws java.io.IOException {
-
+
String encodedData = null;
Base64.InputStream bis = null;
try
@@ -1544,20 +1544,20 @@ public class Base64
byte[] buffer = new byte[ Math.max((int)(file.length() * 1.4+1),40) ]; // Need max() for math on small files (v2.2.1); Need +1 for a few corner cases (v2.3.5)
int length = 0;
int numBytes = 0;
-
+
// Open a stream
- bis = new Base64.InputStream(
- new java.io.BufferedInputStream(
+ bis = new Base64.InputStream(
+ new java.io.BufferedInputStream(
new java.io.FileInputStream( file ) ), Base64.ENCODE );
-
+
// Read until done
while( ( numBytes = bis.read( buffer, length, 4096 ) ) >= 0 ) {
length += numBytes;
} // end while
-
+
// Save in a variable to return
encodedData = new String( buffer, 0, length, Base64.PREFERRED_ENCODING );
-
+
} // end try
catch( java.io.IOException e ) {
throw e; // Catch and release to execute finally{}
@@ -1565,10 +1565,10 @@ public class Base64
finally {
try{ bis.close(); } catch( Exception e) {}
} // end finally
-
+
return encodedData;
} // end encodeFromFile
-
+
/**
* Reads infile and encodes it to outfile.
*
@@ -1579,7 +1579,7 @@ public class Base64
*/
public static void encodeFileToFile( String infile, String outfile )
throws java.io.IOException {
-
+
String encoded = Base64.encodeFromFile( infile );
java.io.OutputStream out = null;
try{
@@ -1593,7 +1593,7 @@ public class Base64
finally {
try { out.close(); }
catch( Exception ex ){}
- } // end finally
+ } // end finally
} // end encodeFileToFile
@@ -1607,7 +1607,7 @@ public class Base64
*/
public static void decodeFileToFile( String infile, String outfile )
throws java.io.IOException {
-
+
byte[] decoded = Base64.decodeFromFile( infile );
java.io.OutputStream out = null;
try{
@@ -1621,14 +1621,14 @@ public class Base64
finally {
try { out.close(); }
catch( Exception ex ){}
- } // end finally
+ } // end finally
} // end decodeFileToFile
-
-
+
+
/* ******** I N N E R C L A S S I N P U T S T R E A M ******** */
-
-
-
+
+
+
/**
* A {@link Base64.InputStream} will read data from another
* java.io.InputStream, given in the constructor,
@@ -1638,18 +1638,18 @@ public class Base64
* @since 1.3
*/
public static class InputStream extends java.io.FilterInputStream {
-
- private boolean encode; // Encoding or decoding
+
+ private final boolean encode; // Encoding or decoding
private int position; // Current position in the buffer
- private byte[] buffer; // Small buffer holding converted data
- private int bufferLength; // Length of buffer (3 or 4)
+ private final byte[] buffer; // Small buffer holding converted data
+ private final int bufferLength; // Length of buffer (3 or 4)
private int numSigBytes; // Number of meaningful bytes in the buffer
private int lineLength;
- private boolean breakLines; // Break lines at less than 80 characters
- private int options; // Record options used to create the stream.
- private byte[] decodabet; // Local copies to avoid extra method calls
-
-
+ private final boolean breakLines; // Break lines at less than 80 characters
+ private final int options; // Record options used to create the stream.
+ private final byte[] decodabet; // Local copies to avoid extra method calls
+
+
/**
* Constructs a {@link Base64.InputStream} in DECODE mode.
*
@@ -1659,8 +1659,8 @@ public class Base64
public InputStream( java.io.InputStream in ) {
this( in, DECODE );
} // end constructor
-
-
+
+
/**
* Constructs a {@link Base64.InputStream} in
* either ENCODE or DECODE mode.
@@ -1682,7 +1682,7 @@ public class Base64
* @since 2.0
*/
public InputStream( java.io.InputStream in, int options ) {
-
+
super( in );
this.options = options; // Record for later
this.breakLines = (options & DO_BREAK_LINES) > 0;
@@ -1693,7 +1693,7 @@ public class Base64
this.lineLength = 0;
this.decodabet = getDecodabet(options);
} // end constructor
-
+
/**
* Reads enough of the input stream to convert
* to/from Base64 and returns the next byte.
@@ -1703,7 +1703,7 @@ public class Base64
*/
@Override
public int read() throws java.io.IOException {
-
+
// Do we need to get data?
if( position < 0 ) {
if( encode ) {
@@ -1719,9 +1719,9 @@ public class Base64
} else {
break; // out of for loop
} // end else: end of stream
-
+
} // end for: each needed input byte
-
+
if( numBinaryBytes > 0 ) {
encode3to4( b3, 0, numBinaryBytes, buffer, 0, options );
position = 0;
@@ -1731,7 +1731,7 @@ public class Base64
return -1; // Must be end of stream
} // end else
} // end if: encoding
-
+
// Else decoding
else {
byte[] b4 = new byte[4];
@@ -1741,14 +1741,14 @@ public class Base64
int b = 0;
do{ b = in.read(); }
while( b >= 0 && decodabet[ b & 0x7f ] <= WHITE_SPACE_ENC );
-
+
if( b < 0 ) {
break; // Reads a -1 if end of stream
} // end if: end of stream
-
+
b4[i] = (byte)b;
} // end for: each needed input byte
-
+
if( i == 4 ) {
numSigBytes = decode4to3( b4, 0, buffer, 0, options );
position = 0;
@@ -1759,18 +1759,18 @@ public class Base64
else {
// Must have broken out from above.
throw new java.io.IOException( "Improperly padded Base64 input." );
- } // end
-
+ } // end
+
} // end else: decode
} // end else: get data
-
+
// Got data?
if( position >= 0 ) {
// End of relevant data?
if( /*!encode &&*/ position >= numSigBytes ){
return -1;
} // end if: got data
-
+
if( encode && breakLines && lineLength >= MAX_LINE_LENGTH ) {
lineLength = 0;
return '\n';
@@ -1779,7 +1779,7 @@ public class Base64
lineLength++; // This isn't important when decoding
// but throwing an extra "if" seems
// just as wasteful.
-
+
int b = buffer[ position++ ];
if( position >= bufferLength ) {
@@ -1790,14 +1790,14 @@ public class Base64
// intended to be unsigned.
} // end else
} // end if: position >= 0
-
+
// Else error
else {
throw new java.io.IOException( "Error in Base64 code reading stream." );
} // end else
} // end read
-
-
+
+
/**
* Calls {@link #read()} repeatedly until the end of stream
* is reached or len bytes are read.
@@ -1811,13 +1811,13 @@ public class Base64
* @since 1.3
*/
@Override
- public int read( byte[] dest, int off, int len )
+ public int read( byte[] dest, int off, int len )
throws java.io.IOException {
int i;
int b;
for( i = 0; i < len; i++ ) {
b = read();
-
+
if( b >= 0 ) {
dest[off + i] = (byte) b;
}
@@ -1830,18 +1830,18 @@ public class Base64
} // end for: each byte read
return i;
} // end read
-
+
} // end inner class InputStream
-
-
-
-
-
-
+
+
+
+
+
+
/* ******** I N N E R C L A S S O U T P U T S T R E A M ******** */
-
-
-
+
+
+
/**
* A {@link Base64.OutputStream} will write data to another
* java.io.OutputStream, given in the constructor,
@@ -1851,18 +1851,18 @@ public class Base64
* @since 1.3
*/
public static class OutputStream extends java.io.FilterOutputStream {
-
- private boolean encode;
+
+ private final boolean encode;
private int position;
private byte[] buffer;
- private int bufferLength;
+ private final int bufferLength;
private int lineLength;
- private boolean breakLines;
- private byte[] b4; // Scratch used in a few places
+ private final boolean breakLines;
+ private final byte[] b4; // Scratch used in a few places
private boolean suspendEncoding;
- private int options; // Record for later
- private byte[] decodabet; // Local copies to avoid extra method calls
-
+ private final int options; // Record for later
+ private final byte[] decodabet; // Local copies to avoid extra method calls
+
/**
* Constructs a {@link Base64.OutputStream} in ENCODE mode.
*
@@ -1872,8 +1872,8 @@ public class Base64
public OutputStream( java.io.OutputStream out ) {
this( out, ENCODE );
} // end constructor
-
-
+
+
/**
* Constructs a {@link Base64.OutputStream} in
* either ENCODE or DECODE mode.
@@ -1906,8 +1906,8 @@ public class Base64
this.options = options;
this.decodabet = getDecodabet(options);
} // end constructor
-
-
+
+
/**
* Writes the byte to the output stream after
* converting to/from Base64 notation.
@@ -1921,19 +1921,19 @@ public class Base64
* @since 1.3
*/
@Override
- public void write(int theByte)
+ public void write(int theByte)
throws java.io.IOException {
// Encoding suspended?
if( suspendEncoding ) {
this.out.write( theByte );
return;
} // end if: supsended
-
+
// Encode?
if( encode ) {
buffer[ position++ ] = (byte)theByte;
if( position >= bufferLength ) { // Enough to encode.
-
+
this.out.write( encode3to4( b4, buffer, bufferLength, options ) );
lineLength += 4;
@@ -1952,7 +1952,7 @@ public class Base64
if( decodabet[ theByte & 0x7f ] > WHITE_SPACE_ENC ) {
buffer[ position++ ] = (byte)theByte;
if( position >= bufferLength ) { // Enough to output.
-
+
int len = Base64.decode4to3( buffer, 0, b4, 0, options );
out.write( b4, 0, len );
position = 0;
@@ -1963,11 +1963,11 @@ public class Base64
} // end else: not white space either
} // end else: decoding
} // end write
-
-
-
+
+
+
/**
- * Calls {@link #write(int)} repeatedly until len
+ * Calls {@link #write(int)} repeatedly until len
* bytes are written.
*
* @param theBytes array from which to read bytes
@@ -1976,22 +1976,22 @@ public class Base64
* @since 1.3
*/
@Override
- public void write( byte[] theBytes, int off, int len )
+ public void write( byte[] theBytes, int off, int len )
throws java.io.IOException {
// Encoding suspended?
if( suspendEncoding ) {
this.out.write( theBytes, off, len );
return;
} // end if: supsended
-
+
for( int i = 0; i < len; i++ ) {
write( theBytes[ off + i ] );
} // end for: each byte written
-
+
} // end write
-
-
-
+
+
+
/**
* Method added by PHIL. [Thanks, PHIL. -Rob]
* This pads the buffer without closing the stream.
@@ -2010,9 +2010,9 @@ public class Base64
} // end flush
-
- /**
- * Flushes and closes (I think, in the superclass) the stream.
+
+ /**
+ * Flushes and closes (I think, in the superclass) the stream.
*
* @since 1.3
*/
@@ -2024,13 +2024,13 @@ public class Base64
// 2. Actually close the stream
// Base class both flushes and closes.
super.close();
-
+
buffer = null;
out = null;
} // end close
-
-
-
+
+
+
/**
* Suspends encoding of the stream.
* May be helpful if you need to embed a piece of
@@ -2043,8 +2043,8 @@ public class Base64
flushBase64();
this.suspendEncoding = true;
} // end suspendEncoding
-
-
+
+
/**
* Resumes encoding of the stream.
* May be helpful if you need to embed a piece of
@@ -2055,10 +2055,10 @@ public class Base64
public void resumeEncoding() {
this.suspendEncoding = false;
} // end resumeEncoding
-
-
-
+
+
+
} // end inner class OutputStream
-
-
+
+
} // end class Base64
diff --git a/org.intrace/testsrc/org/intracetest/agent/StackTraceTest.java b/org.intrace/testsrc/org/intracetest/agent/StackTraceTest.java
index a8faa33..86f8aff 100644
--- a/org.intrace/testsrc/org/intracetest/agent/StackTraceTest.java
+++ b/org.intrace/testsrc/org/intracetest/agent/StackTraceTest.java
@@ -1,18 +1,11 @@
package org.intracetest.agent;
-import java.util.Map;
-
import junit.framework.TestCase;
-import org.intrace.agent.AgentSettings;
import org.intrace.output.trace.TraceHandler;
-import org.intrace.output.trace.TraceSettings;
-import org.intrace.shared.AgentConfigConstants;
-import org.intrace.shared.TraceConfigConstants;
public class StackTraceTest extends TestCase
{
- private static final String MY_PACKAGE_AND_CLASS = "org.intracetest.agent.StackTraceTest";
private String m_stackTrace;
/** Here is the raw stack trace that we want to validate:
*
@@ -23,7 +16,7 @@ org.intracetest.agent.StackTraceTest.c(StackTraceTest.java:57),org.intracetest.a
* java.lang.Thread.getStackTrace
* all org.intrace. activity
*
- *
+ *
*/
public void testStackTrace()
{
@@ -41,14 +34,14 @@ public void testStackTrace()
}
private void validateStackTraceElement(String expectedPackageAndClassAndMethod, String actual) {
String[] partsOfStackTraceElement = actual.split("[\\(:\\)]");
- assertEquals("The package and class and method name were not found in the right place",
- expectedPackageAndClassAndMethod,
+ assertEquals("The package and class and method name were not found in the right place",
+ expectedPackageAndClassAndMethod,
partsOfStackTraceElement[0]);
-
- assertEquals("source file not found in the right place",
- "StackTraceTest.java",
+
+ assertEquals("source file not found in the right place",
+ "StackTraceTest.java",
partsOfStackTraceElement[1]);
-
+
}
private void a() {
b();
diff --git a/org.intrace/testsrc/org/intracetest/agent/TraceSettingsTest.java b/org.intrace/testsrc/org/intracetest/agent/TraceSettingsTest.java
index fe34af4..bcd7476 100644
--- a/org.intrace/testsrc/org/intracetest/agent/TraceSettingsTest.java
+++ b/org.intrace/testsrc/org/intracetest/agent/TraceSettingsTest.java
@@ -4,9 +4,7 @@ import java.util.Map;
import junit.framework.TestCase;
-import org.intrace.agent.AgentSettings;
import org.intrace.output.trace.TraceSettings;
-import org.intrace.shared.AgentConfigConstants;
import org.intrace.shared.TraceConfigConstants;
public class TraceSettingsTest extends TestCase
@@ -25,7 +23,7 @@ public class TraceSettingsTest extends TestCase
+ TraceConfigConstants.EXIT_STACK_TRACE
+ "true"
);
-
+
assertTrue(ts.isArgTraceEnabled());
assertTrue(ts.isEntryExitTraceEnabled());
assertTrue(ts.isBranchTraceEnabled());