commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sebb (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (IO-463) FileSystemUtils#freeSpace can be simplified by using new Java 6 File methods
Date Wed, 03 Dec 2014 15:15:13 GMT

    [ https://issues.apache.org/jira/browse/IO-463?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14233098#comment-14233098
] 

Sebb commented on IO-463:
-------------------------

I think we should do both.

I have been looking at this in more detail, and there is a minor issue.
The method freeSpace(String) Javadoc says it does not normalise the value, and may return
the space as bytes, or multiples of 512b or kB depending on OS.
However this method was already deprecated in 1.3 (i.e. a long while ago), so I think it should
not matter if the return value always used kB now.

Or maybe it should return -1 or throw an IOException to force users to update?

> FileSystemUtils#freeSpace can be simplified by using new Java 6 File methods
> ----------------------------------------------------------------------------
>
>                 Key: IO-463
>                 URL: https://issues.apache.org/jira/browse/IO-463
>             Project: Commons IO
>          Issue Type: Improvement
>            Reporter: Sebb
>
> Commons IO now requires Java 1.6, which has some useful new File methods:
> File.getFreeSpace() / getUsableSpace()
> These could be used to radically simplify (and speed up) the FileSystemUtils freeSpace
methods, as well as making it OS-independent.
> The methods should be deprecated in favour of directly calling the File methods directly.
Perhaps even deprecate the entire class?  - it only contains the freeSpace methods currently.
> Note: a lot of the tests will becorme redundant or need reworking.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message