You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Steven Verrell (Jira)" <ji...@apache.org> on 2025/05/19 15:44:00 UTC
[jira] [Updated] (COMPRESS-698) Unexpected Trailing Dot from FileNameUtil.getUncompressedFileName(String)
[ https://issues.apache.org/jira/browse/COMPRESS-698?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Steven Verrell updated COMPRESS-698:
------------------------------------
Priority: Major (was: Minor)
> Unexpected Trailing Dot from FileNameUtil.getUncompressedFileName(String)
> -------------------------------------------------------------------------
>
> Key: COMPRESS-698
> URL: https://issues.apache.org/jira/browse/COMPRESS-698
> Project: Commons Compress
> Issue Type: Bug
> Components: Compressors
> Affects Versions: 1.28.0
> Reporter: Steven Verrell
> Priority: Major
>
> When I tried to identify the suffix of {{"archive.tar.gz"}} and convert it to a version with the {{"gz"}} suffix removed, I called: {{fileNameUtil.getUncompressedFileName(fileName)}} and got {{"archive.tar.", which includes an unexpected trailing dot.}}
> Should the logic of {{getUncompressedFileName}} handle the dot when replacing suffixes?
>
>
> The test code is as follows:
> {code:java}
> // Setup
> Map<String, String> uncompressSuffixMap = new HashMap<>();
> uncompressSuffixMap.put("gz", "");
> FileNameUtil fileNameUtil = new FileNameUtil(uncompressSuffixMap, "default");
> // Test case
> String fileName = "archive.tar.gz";
> String expected = "archive.tar";
> String actual = fileNameUtil.getUncompressedFileName(fileName);
> assertEquals(expected, actual); {code}
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)