Skip to content

Commit 418d7a0

Browse files
committed
Renamed shutdownXxx methods to closeQuietly(Xxx).
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/io/trunk@140449 13f79535-47bb-0310-9956-ffa450edef68
1 parent 65b3c8a commit 418d7a0

3 files changed

Lines changed: 18 additions & 18 deletions

File tree

src/java/org/apache/commons/io/FileUtils.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@
116116
* @author <a href="mailto:jefft@apache.org">Jeff Turner</a>
117117
* @author Matthew Hawthorne
118118
* @author <a href="mailto:jeremias@apache.org">Jeremias Maerki</a>
119-
* @version $Id: FileUtils.java,v 1.20 2003/12/25 11:05:59 jeremias Exp $
119+
* @version $Id: FileUtils.java,v 1.21 2003/12/29 03:28:53 bayard Exp $
120120
*/
121121
public class FileUtils {
122122

@@ -322,8 +322,8 @@ public static boolean contentEquals(final File file1, final File file2)
322322
return IOUtils.contentEquals(input1, input2);
323323

324324
} finally {
325-
IOUtils.shutdownStream(input1);
326-
IOUtils.shutdownStream(input2);
325+
IOUtils.closeQuietly(input1);
326+
IOUtils.closeQuietly(input2);
327327
}
328328
}
329329

@@ -429,10 +429,10 @@ public static void copyFile(final File source, final File destination)
429429
try {
430430
CopyUtils.copy(input, output);
431431
} finally {
432-
IOUtils.shutdownStream(output);
432+
IOUtils.closeQuietly(output);
433433
}
434434
} finally {
435-
IOUtils.shutdownStream(input);
435+
IOUtils.closeQuietly(input);
436436
}
437437

438438
if (source.length() != destination.length()) {
@@ -482,10 +482,10 @@ public static void copyURLToFile(final URL source, final File destination)
482482
try {
483483
CopyUtils.copy(input, output);
484484
} finally {
485-
IOUtils.shutdownStream(output);
485+
IOUtils.closeQuietly(output);
486486
}
487487
} finally {
488-
IOUtils.shutdownStream(input);
488+
IOUtils.closeQuietly(input);
489489
}
490490
}
491491

@@ -595,7 +595,7 @@ public static String readFileToString(
595595
try {
596596
return IOUtils.toString(in, encoding);
597597
} finally {
598-
IOUtils.shutdownStream(in);
598+
IOUtils.closeQuietly(in);
599599
}
600600
}
601601

@@ -621,7 +621,7 @@ public static void writeStringToFile(final File file,
621621
try {
622622
out.write(data.getBytes(encoding));
623623
} finally {
624-
IOUtils.shutdownStream(out);
624+
IOUtils.closeQuietly(out);
625625
}
626626
}
627627

src/java/org/apache/commons/io/IOUtils.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@
145145
*
146146
* @author <a href="mailto:peter@apache.org">Peter Donald</a>
147147
* @author <a href="mailto:jefft@apache.org">Jeff Turner</a>
148-
* @version CVS $Revision: 1.7 $ $Date: 2003/11/22 20:19:29 $
148+
* @version CVS $Revision: 1.8 $ $Date: 2003/12/29 03:28:53 $
149149
*/
150150
public final class IOUtils
151151
{
@@ -162,7 +162,7 @@ public IOUtils() {}
162162
*
163163
* @param input A (possibly null) Reader
164164
*/
165-
public static void shutdownReader( final Reader input )
165+
public static void closeQuietly( final Reader input )
166166
{
167167
if( input == null )
168168
{
@@ -184,7 +184,7 @@ public static void shutdownReader( final Reader input )
184184
*
185185
* @param output A (possibly null) Writer
186186
*/
187-
public static void shutdownWriter( final Writer output )
187+
public static void closeQuietly( final Writer output )
188188
{
189189
if( output == null )
190190
{
@@ -205,7 +205,7 @@ public static void shutdownWriter( final Writer output )
205205
* Equivalent to {@link OutputStream#close()}, except any exceptions will be ignored.
206206
* @param output A (possibly null) OutputStream
207207
*/
208-
public static void shutdownStream( final OutputStream output )
208+
public static void closeQuietly( final OutputStream output )
209209
{
210210
if( output == null )
211211
{
@@ -226,7 +226,7 @@ public static void shutdownStream( final OutputStream output )
226226
* Equivalent to {@link InputStream#close()}, except any exceptions will be ignored.
227227
* @param input A (possibly null) InputStream
228228
*/
229-
public static void shutdownStream( final InputStream input )
229+
public static void closeQuietly( final InputStream input )
230230
{
231231
if( input == null )
232232
{

src/test/org/apache/commons/io/testtools/FileBasedTestCase.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
2-
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//io/src/test/org/apache/commons/io/testtools/FileBasedTestCase.java,v 1.3 2003/11/22 20:09:23 jeremias Exp $
3-
* $Revision: 1.3 $
4-
* $Date: 2003/11/22 20:09:23 $
2+
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//io/src/test/org/apache/commons/io/testtools/FileBasedTestCase.java,v 1.4 2003/12/29 03:28:53 bayard Exp $
3+
* $Revision: 1.4 $
4+
* $Date: 2003/12/29 03:28:53 $
55
*
66
* ====================================================================
77
* The Apache Software License, Version 1.1
@@ -104,7 +104,7 @@ protected void createFile(final File file, final long size)
104104
try {
105105
generateTestData(output, size);
106106
} finally {
107-
IOUtils.shutdownStream(output);
107+
IOUtils.closeQuietly(output);
108108
}
109109
}
110110

0 commit comments

Comments
 (0)