Skip to Content.
Sympa Menu

perfsonar-dev - perfsonar: r4990 - branches/new-structure-with-base2/ps-mdm-base2/src/main/java/org/perfsonar/base2/service/storage/xml/exist

Subject: perfsonar development work

List archive

perfsonar: r4990 - branches/new-structure-with-base2/ps-mdm-base2/src/main/java/org/perfsonar/base2/service/storage/xml/exist


Chronological Thread 
  • From:
  • To:
  • Subject: perfsonar: r4990 - branches/new-structure-with-base2/ps-mdm-base2/src/main/java/org/perfsonar/base2/service/storage/xml/exist
  • Date: Thu, 26 Feb 2009 08:40:52 -0500

Author: mac
Date: 2009-02-26 08:40:50 -0500 (Thu, 26 Feb 2009)
New Revision: 4990

Modified:

branches/new-structure-with-base2/ps-mdm-base2/src/main/java/org/perfsonar/base2/service/storage/xml/exist/HTTPAccess.java
Log:
Change base64 encoding to apache.commons

Modified:
branches/new-structure-with-base2/ps-mdm-base2/src/main/java/org/perfsonar/base2/service/storage/xml/exist/HTTPAccess.java
===================================================================
---
branches/new-structure-with-base2/ps-mdm-base2/src/main/java/org/perfsonar/base2/service/storage/xml/exist/HTTPAccess.java
2009-02-26 12:17:58 UTC (rev 4989)
+++
branches/new-structure-with-base2/ps-mdm-base2/src/main/java/org/perfsonar/base2/service/storage/xml/exist/HTTPAccess.java
2009-02-26 13:40:50 UTC (rev 4990)
@@ -6,8 +6,10 @@
import java.net.HttpURLConnection;
import java.net.URL;

+import org.apache.commons.codec.binary.Base64;


+
/**
* This class implements basic HTTP methods of eXist DB XML
* document manipulating. Most of them may be used in communication
@@ -184,12 +186,20 @@
if (debug) System.out.println("[D] authorization Basic "+
username+":"+password);

- String basicAuth = "Basic " +
- (new sun.misc.BASE64Encoder().
- encode((username+":"+password).getBytes()));

+ //encode BASE 64
+ String userAndPass = username+":"+password;
+ Base64 base64encoder = new Base64();
+ String userAndPass64 = new String(base64encoder.encode(
+ userAndPass.getBytes()));

+ String basicAuth = "Basic " + userAndPass64;
+
httpUrlConnection.setRequestProperty(
"Authorization", basicAuth);
+
+
+ httpUrlConnection.setRequestProperty(
+ "Authorization", basicAuth);

}
}



  • perfsonar: r4990 - branches/new-structure-with-base2/ps-mdm-base2/src/main/java/org/perfsonar/base2/service/storage/xml/exist, svnlog, 02/26/2009

Archive powered by MHonArc 2.6.16.

Top of Page