[
https://issues.apache.org/jira/browse/IO-416?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14151641#comment-14151641
]
Tyler Barrus commented on IO-416:
---------------------------------
Sebb, the reason I went with changing the filename stem because of the side
effect of changing the extension. It could be simplified to something like
"filename stem.txt" -> "filename stem - *.txt" if that would be preferable.
I also thought about having the user be able to define how they would like the
change. Perhaps this is really the best overall solution and something I am
willing to help with if that is where this method should head.
I can change the name to nextOneUpFile as that is what was originally suggested
unless there is a better naming convention for a util of this type.
> 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)