You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by GitBox <gi...@apache.org> on 2019/12/05 07:21:46 UTC

[GitHub] [commons-compress] PeterAlfreadLee commented on a change in pull request #86: COMPRESS-477 building a split zip

PeterAlfreadLee commented on a change in pull request #86: COMPRESS-477 building a split zip
URL: https://github.com/apache/commons-compress/pull/86#discussion_r354142056
 
 

 ##########
 File path: src/main/java/org/apache/commons/compress/compressors/FileNameUtil.java
 ##########
 @@ -193,4 +193,19 @@ public String getCompressedFilename(final String fileName) {
         return fileName + defaultExtension;
     }
 
+    public static String getBaseName(String filename) {
+        if (filename == null) {
+            return null;
+        }
+
+        int lastSeparatorPosition = Math.max(filename.lastIndexOf('/'), filename.lastIndexOf('\\'));
+        String name = filename.substring(lastSeparatorPosition + 1);
 
 Review comment:
   Agree

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services