public static String guessToWords(String s) { if (s == null) { return null; } if (isAllLowerCase(s) || isAllUpperCase(s)) { return letterOrDigitToWords(s); } else { return camelCaseToWords(s); } }
/** * Computes the name of the file used to store this page's content. The default implementation * returns "text.html". * @see com.manydesigns.portofino.pageactions.text.TextAction#locateTextFile() * @return the name of the file. */ protected String computeTextFileName() { return RandomUtil.getCodeFileName(TEXT_FILE_NAME_PATTERN, "text"); }
/** * Returns a subpath of the page instance path. * @param startIndex the index in the path that the subpath starts from. */ public PageInstance[] getPageInstancePath(int startIndex) { return Util.copyOfRange(pageInstancePath, startIndex, pageInstancePath.length); }
@Override public String call() { return RandomUtil.createRandomId(size); } };
public static Object newInstance(Class aClass) { Constructor constructor = getConstructor(aClass); return newInstance(constructor); }
public static File getTempCodeFile(String fileNameFormat, String randomCode) { return getCodeFile(tempDir, fileNameFormat, randomCode); }
public static Constructor getConstructor(String className, Class... argClasses) { return getConstructor(loadClass(className), argClasses); }
public static List<Field> collectVisibleFields(Form form, List<Field> fields) { for(FieldSet fieldSet : form) { collectVisibleFields(fieldSet, fields); } return fields; }
public static boolean setReadable(File file, boolean readable) { String perms = readable ? "u+rx" : "a-rx"; return chmod(file, perms); }
@Override public String call() { return RandomUtil.createRandomId(size); } };
public static Object newInstance(Class aClass) { Constructor constructor = getConstructor(aClass); return newInstance(constructor); }
public static String guessToWords(String s) { if (s == null) { return null; } if (isAllLowerCase(s) || isAllUpperCase(s)) { return letterOrDigitToWords(s); } else { return camelCaseToWords(s); } }
public static File getTempCodeFile(String fileNameFormat, String randomCode) { return getCodeFile(tempDir, fileNameFormat, randomCode); }
public static Constructor getConstructor(String className, Class... argClasses) { return getConstructor(loadClass(className), argClasses); }
public static List<Field> collectVisibleFields(Form form, List<Field> fields) { for(FieldSet fieldSet : form) { collectVisibleFields(fieldSet, fields); } return fields; }
public static boolean setWritable(File file, boolean writable) { String perms = writable ? "u+w" : "a-w"; return chmod(file, perms); }
@Override public String generateNewCode() { return RandomUtil.createRandomId(25); }
public static boolean setReadable(File file, boolean readable) { String perms = readable ? "u+rx" : "a-rx"; return chmod(file, perms); }
@Override public String generateNewCode() { return RandomUtil.createRandomId(25); }
public static boolean setWritable(File file, boolean writable) { String perms = writable ? "u+w" : "a-w"; return chmod(file, perms); }