You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by br...@apache.org on 2004/04/28 05:19:25 UTC
cvs commit: maven build-bootstrap.xml
brett 2004/04/27 20:19:25
Modified: src/java/org/apache/maven/util Tag: MAVEN-1_0-BRANCH
HttpUtils.java
. Tag: MAVEN-1_0-BRANCH build-bootstrap.xml
Added: src/java/org/apache/maven/util Tag: MAVEN-1_0-BRANCH
Base64.java
Log:
PR: MAVEN-1129
Submitted by: John Casey
Base64 implementation to avoid using private sun classes
Revision Changes Path
No revision
No revision
1.28.4.7 +1 -16 maven/src/java/org/apache/maven/util/HttpUtils.java
Index: HttpUtils.java
===================================================================
RCS file: /home/cvs/maven/src/java/org/apache/maven/util/HttpUtils.java,v
retrieving revision 1.28.4.6
retrieving revision 1.28.4.7
diff -u -r1.28.4.6 -r1.28.4.7
--- HttpUtils.java 21 Apr 2004 13:53:53 -0000 1.28.4.6
+++ HttpUtils.java 28 Apr 2004 03:19:25 -0000 1.28.4.7
@@ -241,22 +241,7 @@
if ( username != null || password != null )
{
String up = username + ":" + password;
- 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.
- }
+ String encoding = Base64.encode(up.getBytes(), true);
connection.setRequestProperty( "Authorization", "Basic " + encoding );
}
No revision
Index: HttpUtils.java
===================================================================
RCS file: /home/cvs/maven/src/java/org/apache/maven/util/HttpUtils.java,v
retrieving revision 1.28.4.6
retrieving revision 1.28.4.7
diff -u -r1.28.4.6 -r1.28.4.7
--- HttpUtils.java 21 Apr 2004 13:53:53 -0000 1.28.4.6
+++ HttpUtils.java 28 Apr 2004 03:19:25 -0000 1.28.4.7
@@ -241,22 +241,7 @@
if ( username != null || password != null )
{
String up = username + ":" + password;
- 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.
- }
+ String encoding = Base64.encode(up.getBytes(), true);
connection.setRequestProperty( "Authorization", "Basic " + encoding );
}
No revision
Index: HttpUtils.java
===================================================================
RCS file: /home/cvs/maven/src/java/org/apache/maven/util/HttpUtils.java,v
retrieving revision 1.28.4.6
retrieving revision 1.28.4.7
diff -u -r1.28.4.6 -r1.28.4.7
--- HttpUtils.java 21 Apr 2004 13:53:53 -0000 1.28.4.6
+++ HttpUtils.java 28 Apr 2004 03:19:25 -0000 1.28.4.7
@@ -241,22 +241,7 @@
if ( username != null || password != null )
{
String up = username + ":" + password;
- 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.
- }
+ String encoding = Base64.encode(up.getBytes(), true);
connection.setRequestProperty( "Authorization", "Basic " + encoding );
}
1.1.2.1 +388 -0 maven/src/java/org/apache/maven/util/Attic/Base64.java
No revision
No revision
1.212.2.7 +1 -0 maven/build-bootstrap.xml
Index: build-bootstrap.xml
===================================================================
RCS file: /home/cvs/maven/build-bootstrap.xml,v
retrieving revision 1.212.2.6
retrieving revision 1.212.2.7
diff -u -r1.212.2.6 -r1.212.2.7
--- build-bootstrap.xml 10 Mar 2004 11:01:50 -0000 1.212.2.6
+++ build-bootstrap.xml 28 Apr 2004 03:19:25 -0000 1.212.2.7
@@ -349,6 +349,7 @@
<src path="src"/>
<include name="bootstrap/**"/>
<include name="java/**/HttpUtils*"/>
+ <include name="java/**/Base64*"/>
</javac>
</target>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org