You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hivemind.apache.org by hl...@apache.org on 2005/03/14 15:58:54 UTC
cvs commit: jakarta-hivemind/framework/src/test/org/apache/hivemind/impl TestServiceInterceptorContributionImpl.java
hlship 2005/03/14 06:58:53
Modified: framework/src/java/org/apache/hivemind/impl
MessageFinderImpl.java
framework/src/test/org/apache/hivemind/parse
TestXmlResourceProcessor.java
framework/src/test/org/apache/hivemind/impl
TestServiceInterceptorContributionImpl.java
Added: framework/src/java/org/apache/hivemind/util IOUtils.java
Log:
Add IOUtils, with convienence methods for closing InputStreams.
Revision Changes Path
1.2 +2 -14 jakarta-hivemind/framework/src/java/org/apache/hivemind/impl/MessageFinderImpl.java
Index: MessageFinderImpl.java
===================================================================
RCS file: /home/cvs/jakarta-hivemind/framework/src/java/org/apache/hivemind/impl/MessageFinderImpl.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- MessageFinderImpl.java 11 Feb 2005 15:29:52 -0000 1.1
+++ MessageFinderImpl.java 14 Mar 2005 14:58:53 -0000 1.2
@@ -31,6 +31,7 @@
import org.apache.hivemind.Resource;
import org.apache.hivemind.internal.MessageFinder;
import org.apache.hivemind.util.Defense;
+import org.apache.hivemind.util.IOUtils;
import org.apache.hivemind.util.LocalizedNameGenerator;
/**
@@ -171,25 +172,12 @@
}
finally
{
- close(stream);
+ IOUtils.close(stream);
}
return result;
}
- private void close(InputStream stream)
- {
- if (stream != null)
- try
- {
- stream.close();
- }
- catch (IOException ex)
- {
- // Ignore.
- }
- }
-
/**
* Returns a List of Localizations, in order from most generic (i.e., hivemodule.properties) to
* most specific (i.e., hivemodule_en_US_yokel.properties).
1.1 jakarta-hivemind/framework/src/java/org/apache/hivemind/util/IOUtils.java
Index: IOUtils.java
===================================================================
// Copyright 2005 The Apache Software Foundation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package org.apache.hivemind.util;
import java.io.IOException;
import java.io.InputStream;
/**
* Tiny utilities used with InputStream and friends.
*
* @author Howard M. Lewis Ship
* @since 1.1
*/
public class IOUtils
{
/**
* Closes the input stream, if not null. Eats any IOException.
*/
public static void close(InputStream stream)
{
if (stream != null)
try
{
stream.close();
}
catch (IOException ex)
{
// Ignored.
}
}
}
1.3 +1 -1 jakarta-hivemind/framework/src/test/org/apache/hivemind/parse/TestXmlResourceProcessor.java
Index: TestXmlResourceProcessor.java
===================================================================
RCS file: /home/cvs/jakarta-hivemind/framework/src/test/org/apache/hivemind/parse/TestXmlResourceProcessor.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- TestXmlResourceProcessor.java 19 Feb 2005 19:08:52 -0000 1.2
+++ TestXmlResourceProcessor.java 14 Mar 2005 14:58:53 -0000 1.3
@@ -1,4 +1,4 @@
-//Copyright 2005 The Apache Software Foundation
+// Copyright 2005 The Apache Software Foundation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
1.2 +1 -1 jakarta-hivemind/framework/src/test/org/apache/hivemind/impl/TestServiceInterceptorContributionImpl.java
Index: TestServiceInterceptorContributionImpl.java
===================================================================
RCS file: /home/cvs/jakarta-hivemind/framework/src/test/org/apache/hivemind/impl/TestServiceInterceptorContributionImpl.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- TestServiceInterceptorContributionImpl.java 28 Feb 2005 12:35:43 -0000 1.1
+++ TestServiceInterceptorContributionImpl.java 14 Mar 2005 14:58:53 -0000 1.2
@@ -1,4 +1,4 @@
-//Copyright 2004, 2005 The Apache Software Foundation
+// Copyright 2004, 2005 The Apache Software Foundation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
---------------------------------------------------------------------
To unsubscribe, e-mail: hivemind-cvs-unsubscribe@jakarta.apache.org
For additional commands, e-mail: hivemind-cvs-help@jakarta.apache.org