Here you can find the source of cleanUrl(String encodedUrl)
Parameter | Description |
---|---|
encodedUrl | Encoded String to clean |
public static String cleanUrl(String encodedUrl)
//package com.java2s; /**// w w w . j a v a 2 s . com * $URL$ * $Id$ * * Copyright (c) 2010 The Sakai Foundation * * Licensed under the Educational Community License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.opensource.org/licenses/ECL-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ public class Main { /** * Clean an encoded string so it may be embedded as a query parameter. * * @param encodedUrl * Encoded String to clean * @return Processed URL that is safe to embed as a query parameter. It will * not contain any characters that will interfere with other * parameters. */ public static String cleanUrl(String encodedUrl) { return encodedUrl.replaceAll("\\+", "-").replaceAll("/", "_") .replaceAll("=", ""); } }