From 55f3ff47ea2fd979cd2d61790f85cbba5ba7dc40 Mon Sep 17 00:00:00 2001 From: wisberg Date: Tue, 4 Mar 2003 04:37:22 +0000 Subject: [PATCH] ignoring case in detecting jar/zip suffixes --- util/src/org/aspectj/util/FileUtil.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/util/src/org/aspectj/util/FileUtil.java b/util/src/org/aspectj/util/FileUtil.java index 939329eb3..35405ce59 100644 --- a/util/src/org/aspectj/util/FileUtil.java +++ b/util/src/org/aspectj/util/FileUtil.java @@ -55,9 +55,13 @@ public class FileUtil { /** @return 0 if no zip/jar suffix or 4 otherwise */ public static int zipSuffixLength(String path) { - return (null == path ? 0 - : path.endsWith(".zip") ? 4 - : path.endsWith(".jar") ? 4 : 0); + if ((null != path) && (4 < path.length())){ + String test = path.substring(path.length()-4).toLowerCase(); + if (".zip".equals(test) || ".jar".equals(test)) { + return 4; + } + } + return 0; } /** @return true if file path has a source suffix */ -- 2.39.5