1 19 20 package org.netbeans.modules.web.core.jsploader; 21 22 import org.openide.filesystems.FileObject; 23 import org.openide.filesystems.FileUtil; 24 25 29 public class JspCompileUtil { 30 31 38 public static String findRelativeContextPath(FileObject rootFolder, FileObject relativeObject) { 39 String result = "/" + FileUtil.getRelativePath(rootFolder, relativeObject); return relativeObject.isFolder() ? (result + "/") : result; } 42 43 48 public static boolean isJspFile(FileObject fo, boolean acceptSegment) { 49 String ext = fo.getExt().toLowerCase(); 50 if ("jsp".equals(ext) || "jspx".equals(ext)) { return true; 52 } 53 if ("jspf".equals(ext) && acceptSegment) { return true; 55 } 56 return false; 57 } 58 59 64 public static boolean isTagFile(FileObject fo, boolean acceptSegment) { 65 String ext = fo.getExt().toLowerCase(); 66 if ("tag".equals(ext) || "tagx".equals(ext)) { return true; 68 } 69 if ("tagf".equals(ext) && acceptSegment) { return true; 71 } 72 return false; 73 } 74 75 } 76 77 | Popular Tags |