http://jakarta.apache.org/commons/codec

The Jakarta Commons Codec project has a Base64 implementation that is being used in Apache XML-RPC and the Jakarta Commons HttpClient.

--
Ryan Hoegg
ISIS Networks
http://www.isisnetworks.net

Eric Pugh wrote:

Do you  have a patch/suggested class to use?  It seems like here:
String encoding = null;
           // check to see if sun's Base64 encoder is available.
           try
           {
               sun.misc.BASE64Encoder encoder =
                   (sun.misc.BASE64Encoder) Class.forName(
                       "sun.misc.BASE64Encoder" ).newInstance();

               encoding = encoder.encode( up.getBytes() );
           }
           catch ( Exception ex )
           {
               // Do nothing, as for MavenSession we will never use
               // auth and we will eventually move over httpclient
               // in the commons.
           }
           connection.setRequestProperty( "Authorization", "Basic " +
encoding );
       }

We could use this:
http://jakarta.apache.org/commons/codec/apidocs/org/apache/commons/codec/bin
ary/Base64.html

Do you want to try it out and submit a patch to use this?

Eric



-----Original Message-----
From: Dalibor Topic [mailto:[EMAIL PROTECTED]
Sent: Thursday, January 22, 2004 2:25 PM
To: [EMAIL PROTECTED]; Jim Pick
Subject: Building maven CVS under free runtimes (kaffe): Breaks during
compilation


Hi all,


I'm a kaffe developer currently discovering the wonderful
world of maven
;) It seems like a very nice tool to me, and the kaffe
project uses it
for managing the docbook documentation. Maven 1.0 rc1 doesn't
run out of
the box with kaffe (yet), but with a small patch to maven
[1], and a few
patches to kaffe's latest CVS it's possible to get quite far [2].

Encouraged by this, I tried to build maven's latest CVS with
kaffe, and
again, I got quite far with maven jar. Unfortunately, the compilation
doesn't succeed:

bash-2.05a$ MAVEN_OPTS=-Dbuild.compiler=kjc maven jar
 __  __
|  \/  |__ _Apache__ ___
| |\/| / _` \ V / -_) ' \  ~ intelligent projects ~
|_|  |_\__,_|\_/\___|_||_|  v. 1.0-rc1-SNAPSHOT

java:prepare-filesystem:

java:compile:
    [echo] Compiling to /tmp/topic/maven/target/classes
    [javac] Compiling 93 source files to
/tmp/topic/maven/target/classes
/tmp/topic/maven/src/java/org/apache/maven/util/HttpUtils.java:244:
error:Cannot find type "sun/misc/BASE64Encoder"

BUILD FAILED

Since no good code uses sun internal classes, I'm sure it would be
possible to remove the reference to "sun/misc/BASE64Encoder",
in order
to make it compile on free runtimes, as well.

I believe ant had a similar problem, and it was fixed by using
reflection. Of course, putting

             sun.misc.BASE64Encoder encoder =
                    (sun.misc.BASE64Encoder) Class.forName(
                        "sun.misc.BASE64Encoder" ).newInstance();

straight in the code, makes the point of using reflection
quite moot ;)

cheers,
dalibor topic

[1] Remove the unmecessary tools.jar entry in forehead.conf
[2] http://www.kaffe.org/~robilad/mavenized-kaffe-website.png
maven jar works fine. maven site:generate breaks due to some
code using
some unportable (i.e. sun internal) classes.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to