public FastStr beforeFirst(String s) { return beforeFirst(unsafeOf(s)); }
public FastStr beforeFirst(String s) { return beforeFirst(unsafeOf(s)); }
public static File sourceFile(List<File> sourceRoots, String className) { FastStr s = FastStr.of(className).beforeFirst('$'); s = s.replace('.', File.separatorChar).append(".java"); for (File sourceRoot : sourceRoots) { File file = new File(sourceRoot, s.toString()); if (file.canRead()) { return file; } } return null; }
public static File sourceFile(List<File> sourceRoots, String className) { FastStr s = FastStr.of(className).beforeFirst('$'); s = s.replace('.', File.separatorChar).append(".java"); for (File sourceRoot : sourceRoots) { File file = new File(sourceRoot, s.toString()); if (file.canRead()) { return file; } } return null; }
@Override public Void apply(JarFile jarFile, JarEntry jarEntry) throws NotAppliedException, $.Break { try { String fileName = jarEntry.getName(); if (fileName.startsWith("conf/")) { FastStr fs = FastStr.of(fileName).afterFirst('/'); String env = ConfLoader.common(); if (fs.contains('/')) { env = fs.beforeFirst('/').intern(); } Properties p = map.get(env); if (null == p) { p = new Properties(); map.put(env, p); } InputStream is = jarFile.getInputStream(jarEntry); Properties p2 = new Properties(); p2.load(is); p.putAll(p2); } } catch (IOException e) { logger.warn(e, "Unable to load properties file from jar entry %s", jarEntry.getName()); } return null; } };
@Override public Void apply(JarFile jarFile, JarEntry jarEntry) throws NotAppliedException, $.Break { try { String fileName = jarEntry.getName(); if (fileName.startsWith("conf/")) { FastStr fs = FastStr.of(fileName).afterFirst('/'); String env = ConfLoader.common(); if (fs.contains('/')) { env = fs.beforeFirst('/').intern(); } Properties p = map.get(env); if (null == p) { p = new Properties(); map.put(env, p); } InputStream is = jarFile.getInputStream(jarEntry); Properties p2 = new Properties(); p2.load(is); p.putAll(p2); } } catch (IOException e) { logger.warn(e, "Unable to load properties file from jar entry %s", jarEntry.getName()); } return null; } };
public static String classNameToClassFileName(String className, boolean keepInnerClass) { FastStr fs = FastStr.of(className); if (!keepInnerClass && className.contains("$")) { fs = fs.beforeFirst('$'); } fs = fs.replace('.', '/').append(".class").prepend('/'); return fs.toString(); }
public static String classNameToClassFileName(String className, boolean keepInnerClass) { FastStr fs = FastStr.of(className); if (!keepInnerClass && className.contains("$")) { fs = fs.beforeFirst('$'); } fs = fs.replace('.', '/').append(".class").prepend('/'); return fs.toString(); }
private $.T2<String, String> splitActionStr(String action) { FastStr fs = FastStr.of(action); FastStr fs1 = fs.beforeFirst(':'); FastStr fs2 = fs1.isEmpty() ? fs : fs.substr(fs1.length() + 1); return $.T2(fs1.trim().toString(), fs2.trim().toString()); }
private $.T2<String, String> splitActionStr(String action) { FastStr fs = FastStr.of(action); FastStr fs1 = fs.beforeFirst(':'); FastStr fs2 = fs1.isEmpty() ? fs : fs.substr(fs1.length() + 1); return $.T2(fs1.trim().toString(), fs2.trim().toString()); }