|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectutilidades.UrlUtils
public class UrlUtils
Clase con métodos para codificar URLs.
-----------------------------------------------------------------------------
URL Utils - UrlUtils.java
Author: C. Enrique Ortiz
Copyright (c) 2004-2005 C. Enrique Ortiz
This is free software; you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the Free
Software Foundation; either version 2 of the License, or (at your option) any
later version.
Usage & redistributions of source code must retain the above copyright notice.
This software is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should get a copy of the GNU Lesser General Public License from
the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
Boston, MA 02111-1307 USA
-----------------------------------------------------------------------------
Modificado por David Domínguez.
La clase contiene un método estático para codificar todos los caracteres, excepto los de
tipo mark
y los permitidos, de un String
que representa una URL. Se
ha añadido un método similar pero que no codifica tampoco los caracteres reservados.
Field Summary | |
---|---|
private static java.lang.String |
mark
Caracteres marcas no reservadas |
private static java.lang.String |
reservados
Caracteres reservados |
Constructor Summary | |
---|---|
UrlUtils()
|
Method Summary | |
---|---|
static java.lang.String |
encodeURL(java.lang.String url)
Encodes a URL - This method assumes UTF-8 Codifica todos los caracteres excepto los permitidos, los reservados y los mark
. |
static java.lang.String |
encodeURLReserved(java.lang.String url)
Encodes a URL - This method assumes UTF-8 Codifica todos los caracteres especiales, incluidos los caracteres reservados. |
private static char |
toHexChar(int digitValue)
Converts Hex digit to a UTF-8 "Hex" character. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static java.lang.String mark
private static java.lang.String reservados
Constructor Detail |
---|
public UrlUtils()
Method Detail |
---|
private static char toHexChar(int digitValue)
digitValue
- digit to convert to Hex
public static java.lang.String encodeURLReserved(java.lang.String url)
url
- URL to encode
public static java.lang.String encodeURL(java.lang.String url)
mark
. Se utiliza para codificar URLs totales o parciales para que no codifique los
caracteres reservados, como los separadores, que se supone que son separadores.
Método añadido a la clase.
url
- string con la URL a codificar
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |