public static String fromPlain(String u) {
        u = ArchiveUtils.addImpliedHttpIfNecessary(u);
        boolean trailingSlash = u.endsWith("/");
        // ensure all typical UURI cleanup (incl. IDN-punycoding) is done
        try {
            u = UsableURIFactory.getInstance(u).toString();
        } catch (URIException e) {
            e.printStackTrace();
            // allow to continue with original string uri
        }
        // except: don't let UURI-fixup add a trailing slash
        // if it wasn't already there (presence or absence of
        // such slash has special meaning specifying implied
        // SURT prefixes)
        if(!trailingSlash && u.endsWith("/")) {
            u = u.substring(0,u.length()-1);
        }
        // convert to full SURT
        u = SURT.fromURI(u);
        return u;
    }
public static String fromPlain ( String u ) { u = ArchiveUtils . addImpliedHttpIfNecessary ( u ) ; boolean trailingSlash = u . endsWith ( "/" ) ; try { u = UsableURIFactory . getInstance ( u ) . toString ( ) ; } catch ( URIException e ) { e . printStackTrace ( ) ; } if ( ! trailingSlash && u . endsWith ( "/" ) ) { u = u . substring ( 0 , u . length ( ) - 1 ) ; } u = SURT . fromURI ( u ) ; return u ; }
Given a plain URI or hostname/hostname+path, give its SURT form.
Results may be unpredictable on strings that cannot
be interpreted as URIs.

UURI 'fixup' is applied to the URI before conversion to SURT
form.

@param u URI or almost-URI to consider
@return implied SURT prefix form