You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commons-dev@ws.apache.org by ch...@apache.org on 2006/09/18 09:21:08 UTC
svn commit: r447299 -
/webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/util/DigestGenerator.java
Author: chinthaka
Date: Mon Sep 18 00:21:07 2006
New Revision: 447299
URL: http://svn.apache.org/viewvc?view=rev&rev=447299
Log:
removing stacktraces
Modified:
webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/util/DigestGenerator.java
Modified: webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/util/DigestGenerator.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/util/DigestGenerator.java?view=diff&rev=447299&r1=447298&r2=447299
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/util/DigestGenerator.java (original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/util/DigestGenerator.java Mon Sep 18 00:21:07 2006
@@ -38,7 +38,7 @@
* @param digestAlgorithm
* @return Returns a byte array representing the calculated digest
*/
- public byte[] getDigest(OMDocument document, String digestAlgorithm) {
+ public byte[] getDigest(OMDocument document, String digestAlgorithm) throws OMException {
byte[] digest = new byte[0];
try {
MessageDigest md = MessageDigest.getInstance(digestAlgorithm);
@@ -59,9 +59,9 @@
md.update(baos.toByteArray());
digest = md.digest();
} catch (NoSuchAlgorithmException e) {
- e.printStackTrace();
+ throw new OMException(e);
} catch (IOException e) {
- e.printStackTrace();
+ throw new OMException(e);
}
return digest;
}
@@ -87,7 +87,7 @@
* @param digestAlgorithm
* @return Returns a byte array representing the calculated digest value
*/
- public byte[] getDigest(OMElement element, String digestAlgorithm) {
+ public byte[] getDigest(OMElement element, String digestAlgorithm) throws OMException {
byte[] digest = new byte[0];
try {
MessageDigest md = MessageDigest.getInstance(digestAlgorithm);
@@ -121,9 +121,9 @@
md.update(baos.toByteArray());
digest = md.digest();
} catch (NoSuchAlgorithmException e) {
- e.printStackTrace();
+ throw new OMException(e);
} catch (IOException e) {
- e.printStackTrace();
+ throw new OMException(e);
}
return digest;
}
@@ -135,7 +135,7 @@
* @param digestAlgorithm
* @return Returns a byte array representing the calculated digest value
*/
- public byte[] getDigest(OMProcessingInstruction pi, String digestAlgorithm) {
+ public byte[] getDigest(OMProcessingInstruction pi, String digestAlgorithm) throws OMException {
byte[] digest = new byte[0];
try {
MessageDigest md = MessageDigest.getInstance(digestAlgorithm);
@@ -149,9 +149,9 @@
md.update(pi.getValue().getBytes("UnicodeBigUnmarked"));
digest = md.digest();
} catch (NoSuchAlgorithmException e) {
- e.printStackTrace();
+ throw new OMException(e);
} catch (UnsupportedEncodingException e) {
- e.printStackTrace();
+ throw new OMException(e);
}
return digest;
}
@@ -163,7 +163,7 @@
* @param digestAlgorithm
* @return Returns a byte array representing the calculated digest value
*/
- public byte[] getDigest(OMAttribute attribute, String digestAlgorithm) {
+ public byte[] getDigest(OMAttribute attribute, String digestAlgorithm) throws OMException {
byte[] digest = new byte[0];
if (!(attribute.getLocalName().equals("xmlns") || attribute.getLocalName().startsWith("xmlns:"))) try {
MessageDigest md = MessageDigest.getInstance(digestAlgorithm);
@@ -177,9 +177,9 @@
md.update(attribute.getAttributeValue().getBytes("UnicodeBigUnmarked"));
digest = md.digest();
} catch (NoSuchAlgorithmException e) {
- e.printStackTrace();
+ throw new OMException(e);
} catch (UnsupportedEncodingException e) {
- e.printStackTrace();
+ throw new OMException(e);
}
return digest;
}
@@ -191,7 +191,7 @@
* @param digestAlgorithm
* @return Returns a byte array representing the calculated digest value
*/
- public byte[] getDigest(OMText text, String digestAlgorithm) {
+ public byte[] getDigest(OMText text, String digestAlgorithm) throws OMException {
byte[] digest = new byte[0];
try {
MessageDigest md = MessageDigest.getInstance(digestAlgorithm);
@@ -202,9 +202,9 @@
md.update(text.getText().getBytes("UnicodeBigUnmarked"));
digest = md.digest();
} catch (NoSuchAlgorithmException e) {
- e.printStackTrace();
+ throw new OMException(e);
} catch (UnsupportedEncodingException e) {
- e.printStackTrace();
+ throw new OMException(e);
}
return digest;
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: commons-dev-help@ws.apache.org