You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Gary D. Gregory (Jira)" <ji...@apache.org> on 2026/04/14 11:40:00 UTC
[jira] [Commented] (IO-890) getName method in FilenameUtils fails if the filename has a separator character in the name
[ https://issues.apache.org/jira/browse/IO-890?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18073434#comment-18073434 ]
Gary D. Gregory commented on IO-890:
------------------------------------
Hello [~sparkhi]
Please provide a failing unit test so we know _exactly_ what you're reporting. You can do this here or as a PR on GitHub.
See also [https://github.com/apache/commons-io/pull/825]
TY!
> getName method in FilenameUtils fails if the filename has a separator character in the name
> --------------------------------------------------------------------------------------------
>
> Key: IO-890
> URL: https://issues.apache.org/jira/browse/IO-890
> Project: Commons IO
> Issue Type: Bug
> Reporter: Saurabh Parkhi
> Priority: Minor
>
> Tried and Replicated on Linux
> * Create a file with backslash in the name e.g. `touch file'\'withbackslash.txt`
> * try to get the filename from the full path, it splits on the last separator returning only part of the file name
>
> As the method operates only on String, it fails, if it generates a File or Path object and get the filename, it will work
--
This message was sent by Atlassian Jira
(v8.20.10#820010)