java/code/src/com/redhat/rhn/taskomatic/task/repomd/CompressingDigestOutputWriter.java |
13 +++-------
java/code/src/com/redhat/rhn/taskomatic/task/repomd/RepositoryWriter.java |
9 ++++++
2 files changed, 13 insertions(+), 9 deletions(-)
New commits:
commit c708534e885f7547bd3c076efbd328b1df998bb4
Author: Tomas Lestach <tlestach(a)redhat.com>
Date: Fri Dec 18 15:11:01 2009 +0100
fixed exception handling
diff --git
a/java/code/src/com/redhat/rhn/taskomatic/task/repomd/CompressingDigestOutputWriter.java
b/java/code/src/com/redhat/rhn/taskomatic/task/repomd/CompressingDigestOutputWriter.java
index aa1319d..a117a97 100644
---
a/java/code/src/com/redhat/rhn/taskomatic/task/repomd/CompressingDigestOutputWriter.java
+++
b/java/code/src/com/redhat/rhn/taskomatic/task/repomd/CompressingDigestOutputWriter.java
@@ -41,21 +41,16 @@ public class CompressingDigestOutputWriter extends OutputStream
implements
*
* @param stream The stream to compress
* @param checksumAlgo checksum algorithm
+ * @throws NoSuchAlgorithmException nosuchalgorithmexception
+ * @throws IOException ioexception
*/
- public CompressingDigestOutputWriter(OutputStream stream, String checksumAlgo) {
- try {
+ public CompressingDigestOutputWriter(OutputStream stream, String checksumAlgo)
+ throws NoSuchAlgorithmException, IOException {
compressedDigestStream = new DigestOutputStream(stream,
MessageDigest.getInstance(checksumAlgo));
compressedStream = new GZIPOutputStream(compressedDigestStream);
uncompressedDigestStream = new DigestOutputStream(compressedStream,
MessageDigest.getInstance(checksumAlgo));
- }
- catch (NoSuchAlgorithmException nsae) {
- // XXX fatal runtime exception
- }
- catch (IOException ioe) {
- // XXX fatal runtime exception
- }
}
/**
diff --git a/java/code/src/com/redhat/rhn/taskomatic/task/repomd/RepositoryWriter.java
b/java/code/src/com/redhat/rhn/taskomatic/task/repomd/RepositoryWriter.java
index f896942..9b52cd5 100644
--- a/java/code/src/com/redhat/rhn/taskomatic/task/repomd/RepositoryWriter.java
+++ b/java/code/src/com/redhat/rhn/taskomatic/task/repomd/RepositoryWriter.java
@@ -126,6 +126,9 @@ public class RepositoryWriter {
catch (IOException e) {
throw new RepomdRuntimeException(e);
}
+ catch (NoSuchAlgorithmException e) {
+ throw new RepomdRuntimeException(e);
+ }
BufferedWriter primaryBufferedWriter = new BufferedWriter(
new OutputStreamWriter(primaryFile));
@@ -366,6 +369,12 @@ public class RepositoryWriter {
catch (FileNotFoundException e) {
throw new RepomdRuntimeException(e);
}
+ catch (NoSuchAlgorithmException e) {
+ throw new RepomdRuntimeException(e);
+ }
+ catch (IOException e) {
+ throw new RepomdRuntimeException(e);
+ }
BufferedWriter updateinfoBufferedWriter = new BufferedWriter(
new OutputStreamWriter(updateinfoFile));
UpdateInfoWriter updateinfo = new UpdateInfoWriter(
Show replies by date