You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Tyler Barrus (JIRA)" <ji...@apache.org> on 2014/10/01 22:09:35 UTC

[jira] [Updated] (IO-416) FileUtil One-Up FileName

     [ https://issues.apache.org/jira/browse/IO-416?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Tyler Barrus updated IO-416:
----------------------------
    Attachment: nextOneUpFile.patch

Attached is a patch that corrects for some of the issues that were brought up in the original patch. 

It appends the increment pattern before the extension (if there is one). I changed the function name to the proposed name and added it to the fileutils class. 

> 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, nextOneUpFile.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)