59 lines
1.7 KiB
Plaintext
Executable File
59 lines
1.7 KiB
Plaintext
Executable File
/**
|
|
*
|
|
*/
|
|
package com.fp.alfresco.util;
|
|
|
|
import java.net.URI;
|
|
import java.net.URISyntaxException;
|
|
|
|
/**
|
|
* Clase utilitaria con funcionalidades adicionales
|
|
* @author bpt
|
|
*
|
|
*/
|
|
public final class UriUtils {
|
|
|
|
/**
|
|
* Método que parsea la url en formato string que el servidor lo pueda
|
|
* procesar.
|
|
*
|
|
* @param url
|
|
* Cadena que forma parte de la url
|
|
* @return cadena formatea.
|
|
* @throws ExceptionWebscript
|
|
* Excepción controlada que define los errores posibles durante
|
|
* el procesamiento con el webscript de Alfresco.
|
|
*/
|
|
public static String formatearParametrosUrl(String url) throws Exception {
|
|
try {
|
|
URI uri = new URI(null, null, null, url, null);
|
|
return uri.toString();
|
|
} catch (URISyntaxException e) {
|
|
throw new Exception("ERROR: No se pudo formatear la url para ser entendida por el servidor \n\t URL = " + url, e);
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Método que parsea la url en formato ASCII que el servidor lo pueda
|
|
* procesar.
|
|
*
|
|
* @param url
|
|
* Cadena que forma parte de la url
|
|
* @return cadena formatea.
|
|
* @throws ExceptionWebscript
|
|
* Excepción controlada que define los errores posibles durante
|
|
* el procesamiento con el webscript de Alfresco.
|
|
*/
|
|
public static String formatearParametrosAsciiUrl(String url) throws Exception {
|
|
try {
|
|
URI uri = new URI(null, null, null, url, null);
|
|
return uri.toASCIIString();
|
|
} catch (URISyntaxException e) {
|
|
// TODO Auto-generated catch block
|
|
throw new Exception("ERROR: No se pudo formatear la url para ser entendida por el servidor \n\t URL = " + url, e);
|
|
}
|
|
}
|
|
|
|
|
|
}
|