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-416) FileUtil One-Up FileName
Date Mon, 29 Sep 2014 13:02:34 GMT

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

Sebb commented on IO-416:
-------------------------

bq. Also, is there a util that lets us know what the max file name length is for a file? If
there is, it would be trivial to add the check in to make sure it isn't too long.

I don't think so. It is OS-specific. There is usually a limit on pathname segments as well
as total pathname length.

But I don't see any point in checking the length.
There are other reasons why file creation may fail later; the application needs to handle
these anyway.

> FileUtil One-Up FileName
> ------------------------
>
>                 Key: IO-416
>                 URL: https://issues.apache.org/jira/browse/IO-416
>             Project: Commons IO
>          Issue Type: Wish
>          Components: Utilities
>            Reporter: BELUGA BEHR
>            Priority: Minor
>         Attachments: incrementFileName.patch
>
>
> Create a FileNameUtil or FileUtil facility that allows for creating a one-up extension
on files that already exist.
> example:
> archive
> +-- file.txt
> +-- file.txt.1
> +-- file.txt.2
> {code}
> File file = FileNameUtils.nextOneUpFile("/archive/file.txt");
> System.out.println(file)
> // output: /archive/file.txt.3
> {code}



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

Mime
View raw message