commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Henri Yandell" <flame...@gmail.com>
Subject [io] Re: svn commit: r482411 - /jakarta/commons/proper/io/trunk/src/java/org/apache/commons/io/FileUtils.java
Date Mon, 04 Dec 2006 23:38:32 GMT
In case this gets missed - this one does change the API in that we're
now throwing an Exception where we didn't used to before. Seems to me
that not throwing it before was a bug, therefore this is an acceptable
API change. I don't know if it was being left open because people felt
it was an unacceptable change, so sending this note.

On 12/4/06, bayard@apache.org <bayard@apache.org> wrote:
> Author: bayard
> Date: Mon Dec  4 15:35:54 2006
> New Revision: 482411
>
> URL: http://svn.apache.org/viewvc?view=rev&rev=482411
> Log:
> Applied the fix suggested by Mirko Friedenhagen in #IO-100. This isn't something that
it's easy to write a unit test for, but it is very easy to write a platform dependent test
and show that the new code correctly throws an exception for '/etc/passwd'
>
> Modified:
>     jakarta/commons/proper/io/trunk/src/java/org/apache/commons/io/FileUtils.java
>
> Modified: jakarta/commons/proper/io/trunk/src/java/org/apache/commons/io/FileUtils.java
> URL: http://svn.apache.org/viewvc/jakarta/commons/proper/io/trunk/src/java/org/apache/commons/io/FileUtils.java?view=diff&rev=482411&r1=482410&r2=482411
> ==============================================================================
> --- jakarta/commons/proper/io/trunk/src/java/org/apache/commons/io/FileUtils.java (original)
> +++ jakarta/commons/proper/io/trunk/src/java/org/apache/commons/io/FileUtils.java Mon
Dec  4 15:35:54 2006
> @@ -142,7 +142,10 @@
>              OutputStream out = new FileOutputStream(file);
>              IOUtils.closeQuietly(out);
>          }
> -        file.setLastModified(System.currentTimeMillis());
> +        boolean success = file.setLastModified(System.currentTimeMillis());
> +        if(!success) {
> +            throw new IOException("Unable to set the last modification time for " +
file);
> +        }
>      }
>
>      //-----------------------------------------------------------------------
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-dev-help@jakarta.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message