File tree Expand file tree Collapse file tree
java/org/apache/commons/io
test/org/apache/commons/io Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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 */
8383public 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
Original file line number Diff line number Diff line change 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 */
3737public 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 }
Original file line number Diff line number Diff line change 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 */
3535public 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 }
You can’t perform that action at this time.
0 commit comments