开发者

Java Maximum File Size

开发者 https://www.devze.com 2022-12-31 19:35 出处:网络
Is there an cross-platform way to determine the maximum file size of the ho开发者_运维百科st OS in Java?No, maximum file size is file system dependent. (you can see a comparison here).

Is there an cross-platform way to determine the maximum file size of the ho开发者_运维百科st OS in Java?


No, maximum file size is file system dependent. (you can see a comparison here). You can figure out the file system type using a platform specific manner (for example, mount on linux).


The largest file is surely no larger than the amount of free space, which you can get via

long FileSystemUtils.freeSpaceKb(String path)

from Apache Commons IO

On JDK 6, you can use File.getFreeSpace() to find the free space of the partition containing the file.

0

精彩评论

暂无评论...
验证码 换一张
取 消