Skip to content

Commit b13ad1c

Browse files
committed
Reestablish JDK 1.3 compatibility.
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/io/trunk@140540 13f79535-47bb-0310-9956-ffa450edef68
1 parent ba12705 commit b13ad1c

3 files changed

Lines changed: 7 additions & 7 deletions

File tree

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@
7878
* @author <a href="mailto:jefft@apache.org">Jeff Turner</a>
7979
* @author Matthew Hawthorne
8080
* @author <a href="mailto:jeremias@apache.org">Jeremias Maerki</a>
81-
* @version $Id: FileUtils.java,v 1.27 2004/02/23 04:35:59 bayard Exp $
81+
* @version $Id: FileUtils.java,v 1.28 2004/03/12 21:44:25 jeremias Exp $
8282
*/
8383
public class FileUtils {
8484

@@ -135,8 +135,8 @@ public static String byteCountToDisplaySize(long size) {
135135
* @throws IOException If an I/O problem occurs
136136
*/
137137
public static void touch(File file) throws IOException {
138-
OutputStream out = new java.io.FileOutputStream(file, true);
139-
out.close();
138+
OutputStream out = new java.io.FileOutputStream(file);
139+
IOUtils.closeQuietly(out);
140140
}
141141

142142

src/test/org/apache/commons/io/FileUtilsTestCase.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
*
3232
* @author Peter Donald
3333
* @author Matthew Hawthorne
34-
* @version $Id: FileUtilsTestCase.java,v 1.11 2004/02/23 05:02:25 bayard Exp $
34+
* @version $Id: FileUtilsTestCase.java,v 1.12 2004/03/12 21:44:47 jeremias Exp $
3535
* @see FileUtils
3636
*/
3737
public class FileUtilsTestCase extends FileBasedTestCase {
@@ -316,7 +316,7 @@ private String replaceAll(
316316
String replaceWith) {
317317
StringBuffer sb = new StringBuffer(text);
318318
while (true) {
319-
int idx = sb.indexOf(lookFor);
319+
int idx = sb.toString().indexOf(lookFor);
320320
if (idx < 0) {
321321
break;
322322
}

src/test/org/apache/commons/io/FilenameUtilsTestCase.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
*
3030
* @author Peter Donald
3131
* @author Matthew Hawthorne
32-
* @version $Id: FilenameUtilsTestCase.java,v 1.5 2004/02/23 05:02:25 bayard Exp $
32+
* @version $Id: FilenameUtilsTestCase.java,v 1.6 2004/03/12 21:44:47 jeremias Exp $
3333
* @see FilenameUtils
3434
*/
3535
public class FilenameUtilsTestCase extends FileBasedTestCase {
@@ -185,7 +185,7 @@ private String replaceAll(
185185
String replaceWith) {
186186
StringBuffer sb = new StringBuffer(text);
187187
while (true) {
188-
int idx = sb.indexOf(lookFor);
188+
int idx = sb.toString().indexOf(lookFor);
189189
if (idx < 0) {
190190
break;
191191
}

0 commit comments

Comments
 (0)