diff --git a/archive/releng.builder/tools/apitools/org.eclipse.wtp.releng.tools.component.core/src/org/eclipse/wtp/releng/tools/component/internal/Location.java b/archive/releng.builder/tools/apitools/org.eclipse.wtp.releng.tools.component.core/src/org/eclipse/wtp/releng/tools/component/internal/Location.java index 561e285f95daa2b58c251d630b47aeb7624e8e35..0a4fa2a2afe4079e0d1f8660764702ae925ba92c 100644 --- a/archive/releng.builder/tools/apitools/org.eclipse.wtp.releng.tools.component.core/src/org/eclipse/wtp/releng/tools/component/internal/Location.java +++ b/archive/releng.builder/tools/apitools/org.eclipse.wtp.releng.tools.component.core/src/org/eclipse/wtp/releng/tools/component/internal/Location.java @@ -106,80 +106,64 @@ public abstract class Location implements ILocation } /** - * Answers <code>true</code> if the path ends in ".jar", ".zip", ".ear", or - * ".war". + * Answers <code>true</code> if the path ends in ".jar", ".zip", or ".ear" * <p> * This code has been optimized to within an inch of its life. * * @param path * The path of the file - * @return boolean <code>true</code> if the path represents a jar, zip, ear, - * or war file. + * @return boolean <code>true</code> if the path represents a jar, zip, ear */ - public static boolean isArchive(String path) - { - if (path == null) - return false; - if (path.length() < 5) - return false; - int index = path.length() - 1; - char extChar = path.charAt(index--); - switch (extChar) - { - case 'p' : - case 'P' : - if (path.endsWith(".zip")) - { - return true; - } - break; - case 'r' : - case 'R' : - extChar = path.charAt(index--); - switch (extChar) - { - case 'a' : - case 'A' : - extChar = path.charAt(index--); - switch (extChar) - { - case 'j' : - case 'J' : - if (path.charAt(index) == '.') - { - return true; - } - break; - case 'w' : - case 'W' : - if (path.charAt(index) == '.') - { - return true; - } - break; - case 'e' : - case 'E' : - if (path.charAt(index) == '.') - { - return true; - } - break; - } - } - break; - } - return false; - } + public static boolean isArchive(String path) { + if (path == null) + return false; + if (path.length() < 5) + return false; + int index = path.length() - 1; + char extChar = path.charAt(index--); + switch (extChar) { + case 'p': + case 'P': + if (path.endsWith(".zip")) { + return true; + } + break; + case 'r': + case 'R': + extChar = path.charAt(index--); + switch (extChar) { + case 'a': + case 'A': + extChar = path.charAt(index--); + switch (extChar) { + case 'j': + case 'J': + if (path.charAt(index) == '.') { + return true; + } + break; + case 'e': + case 'E': + if (path.charAt(index) == '.') { + return true; + } + break; + } + } + break; + } + return false; + } /** - * Answers the extension of the given path. An extension is normally a three - * character addition to the end of a filename separated from the filename by - * the '.' character. - * - * @param path - * a file path, not <code>null</code> - * @return String the extension of the path - */ + * Answers the extension of the given path. An extension is normally a three + * character addition to the end of a filename separated from the filename + * by the '.' character. + * + * @param path + * a file path, not <code>null</code> + * @return String the extension of the path + */ public static String getExtension(String path) { int index = path.lastIndexOf('.');