/** * Utility to convert {@link File} to {@link URL}. * * @param filePath the path of the file * @return the {@link URL} representation of the file. * @throws MalformedURLException * @throws IllegalArgumentException if the file path is null, empty or blank */ public static URL convertFileToURL( String filePath ) throws MalformedURLException { CheckArg.isNotEmpty(filePath, "filePath"); File file = new File(filePath.trim()); return file.toURI().toURL(); }
public void addIrregular( String singular, String plural ) { CheckArg.isNotEmpty(singular, "singular rule"); CheckArg.isNotEmpty(plural, "plural rule"); String singularRemainder = singular.length() > 1 ? singular.substring(1) : ""; String pluralRemainder = plural.length() > 1 ? plural.substring(1) : ""; addPluralize("(" + singular.charAt(0) + ")" + singularRemainder + "$", "$1" + pluralRemainder); addSingularize("(" + plural.charAt(0) + ")" + pluralRemainder + "$", "$1" + singularRemainder); }
String classname, String... classpath ) { CheckArg.isNotEmpty(name, "name"); this.name = name.trim(); this.description = description != null ? description.trim() : "";