Code example for Logger

Methods: finer, finest, isLoggable

0
     *            The HTTP-encoded string. 
     * 
     * @return The string with the url escape characters replaced. 
     */ 
    private static String clean(String raw) {
        if (LOGGER.isLoggable(Level.FINEST)) {
            LOGGER.finest("raw request: " + raw);
        } 
 
        String clean = null;
 
        if (raw != null) {
            try { 
                clean = java.net.URLDecoder.decode(raw, "UTF-8");
            } catch (java.io.UnsupportedEncodingException e) {
                if (LOGGER.isLoggable(Level.FINER)) {
                    LOGGER.finer("Bad encoding for decoder " + e);
                } 
            } 
        } else { 
            return ""; 
        } 
 
        if (LOGGER.isLoggable(Level.FINEST)) {
            LOGGER.finest("cleaned request: " + raw);
        } 
 
        return clean;
    }