Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package org.uberfire.util;
Utilities for working with URIs that functions the same in both client and server code.

Implementation note: there is a separate GWT super-source implementation of this class for client-side use. If modifying this class, be sure to go modify that one too.

public final class URIUtil {
    public static String encodefinal String content ) {
        try {
            return URLEncoder.encodecontent"UTF-8" );
        } catch ( UnsupportedEncodingException e ) {
        return null;
    public static boolean isValidfinal String uri ) {
        try {
            URI.createuri );
            return true;
        } catch ( final Exception ignored ) {
        return false;
New to GrepCode? Check out our FAQ X