From chemit@codelutin.com Thu Jun 30 10:03:31 2011 From: Tony Chemit To: vradi-devel@list.chorem.org Subject: Re: [Vradi-devel] [Vradi-commits] r107 - in trunk/vradi-web/src/main: java/org/chorem/vradi java/org/chorem/vradi/actions resources webapp/WEB-INF/jsp Date: Thu, 30 Jun 2011 10:03:29 +0200 Message-ID: <20110630100329.4e08e115@tc> In-Reply-To: <20110629153049.64C8A15919@nuiton.codelutin.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============5548482707513263789==" --===============5548482707513263789== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Il faut absoluement =C3=A9viter d'utiliser des classes venant du package sun.xxx Tu as du avoir des gros warning =C3=A0 la compilation :( On Wed, 29 Jun 2011 17:30:49 +0200 (CEST) bpoussin@users.chorem.org wrote: > +import sun.misc.BASE64Decoder; > +import sun.misc.BASE64Encoder; > + > /** > * Utilities class > * > @@ -7,9 +19,86 @@ > */ > public class VradiWebHelper { > =20 > + /** to use log facility, just put in your code: > log.info(\"...\"); */ > + static private Log log =3D LogFactory.getLog(VradiWebHelper.class); > + > public static String escapeSciptBalises(String txt) { > =20 > // (?s) activ dotall > (http://download.oracle.com/javase/6/docs/api/java/util/regex/Pattern.html#= DOTALL) > - return txt.replaceAll("(?s)", ""); > + return txt.replaceAll("(?s).*", ""); > } > + > + /** > + * Compresse en gzip la string passee en parametre, la passe en > base64 > + * et l'encode pour passer comme parametre d'une url > + */ > + public static String encode(String s) throws IOException { > + String encType =3D "UTF-8"; > + BASE64Encoder b64enc =3D new BASE64Encoder(); > + --=20 Tony Chemit -------------------- t=C3=A9l: +33 (0) 2 40 50 29 28 email: chemit@codelutin.com http://www.codelutin.com --===============5548482707513263789==--