public static long genLongId() { return generate(LONG_ID, LONG_COUNTER_DIGITS); }
public Form() throws Exception { this("form-" + IdGenerator.genId()); }
public static void delete(File f) throws IOException { delete(f, false); }
@Override protected Document parse(String aName, File aFile) throws Exception { String modelContent = FileUtils.readString(aFile, SettingsConstants.COMMON_ENCODING); return Source2XmlDom.transform(modelContent); }
private static byte[] getRequestContent(HttpServletRequest aRequest) throws IOException { try (InputStream is = aRequest.getInputStream()) { return BinaryUtils.readStream(is, aRequest.getContentLength() >= 0 ? aRequest.getContentLength() : 0); } }
@Override public DynaClass getDynaClass() { if (dynaClass == null) { dynaClass = new JSDynaClass(delegate, REPORT_DYNA_CLASS_PREFIX + IdGenerator.genStringId()); } return dynaClass; }
public File findFileByExtension(String aExt) { for (File file : files) { String ext = FileUtils.getFileExtension(file); if (ext != null && ext.equalsIgnoreCase(aExt)) { return file; } } return null; }
public static StringBuilder as(StringBuilder... aValues) { assert aValues != null; StringBuilder sb = new StringBuilder(); sb.append("["); for (int i = 0; i < aValues.length; i++) { if (i > 0) { sb.append(","); } sb.append(s(aValues[i].toString())); } sb.append("]"); return sb; }
public static File findBrother(File aFile, String aExtension) { if (aFile != null) { String woExt = removeExtension(aFile.getAbsolutePath()); File brother = new File(woExt + "." + aExtension); return brother.exists() ? brother : null; } else { return null; } }
public static String removeExtension(String filename) { if (filename == null) { return null; } int index = indexOfExtension(filename); if (index == -1) { return filename; } else { return filename.substring(0, index); } }
public static void setPropertyReturnType(PropBox pb, Method method) { String typeName = getTypeName(method.getReturnType()); if (typeName != null) { pb.typeName = typeName; } }
public static int indexOfExtension(String filename) { if (filename == null) { return -1; } int extensionPos = filename.lastIndexOf(EXTENSION_SEPARATOR); int lastSeparator = indexOfLastSeparator(filename); return lastSeparator > extensionPos ? -1 : extensionPos; }
public static StringBuilder o(String... aValues) { StringBuilder sb = new StringBuilder(); assert aValues != null && aValues.length % 2 == 0; sb.append("{"); for (int i = 0; i < aValues.length; i += 2) { if (i > 0) { sb.append(","); } sb.append(p(aValues[i], aValues[i + 1])); } sb.append("}"); return sb; }
public SystemPlatypusPrincipal() { super("system-" + IdGenerator.genId(), null, null, null); }
@Override protected ScriptDocument parse(String aDefaultModuleName, File aFile) throws Exception { String source = FileUtils.readString(aFile, SettingsConstants.COMMON_ENCODING); return ScriptDocument.parse(source, aDefaultModuleName); }
public static long genId() { return generate(ID, COUNTER_DIGITS); }
public AnonymousPlatypusPrincipal() { this("anonymous-" + IdGenerator.genId()); }
@Override protected Document parse(String aName, File aFile) throws Exception { String modelContent = FileUtils.readString(aFile, SettingsConstants.COMMON_ENCODING); return Source2XmlDom.transform(modelContent); }
public Form(JComponent aView) throws Exception { this(aView, "form-" + IdGenerator.genId()); }
public void regenerateId() { entityId = IdGenerator.genId(); }