/** * Get the {@link Resourcepart} representing the input String. * * @param resource the input String. * @return the resource part. * @throws XmppStringprepException if an error occurs. */ public static Resourcepart from(String resource) throws XmppStringprepException { resource = XmppStringPrepUtil.resourceprep(resource); // First prep the String, then assure the limits of the *result* assertNotLongerThan1023BytesOrEmpty(resource); return new Resourcepart(resource); } }