<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.6.0_03) on Mon Feb 18 18:24:45 PST 2008 -->
<TITLE>
JOTUtilities
</TITLE>
<META NAME="date" CONTENT="2008-02-18">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style">
<SCRIPT type="text/javascript">
function windowTitle()
{
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="JOTUtilities";
}
}
</SCRIPT>
<NOSCRIPT>
</NOSCRIPT>
</HEAD>
<BODY BGCOLOR="white" onload="windowTitle();">
<HR>
<!-- ========= START OF TOP NAVBAR ======= -->
<A NAME="navbar_top"><!-- --></A>
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../net/jot/utils/JOTHTMLUtilities.html" title="class in net.jot.utils"><B>PREV CLASS</B></A>
NEXT CLASS</FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../index.html?net/jot/utils/JOTUtilities.html" target="_top"><B>FRAMES</B></A>
<A HREF="JOTUtilities.html" target="_top"><B>NO FRAMES</B></A>
<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY: NESTED | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A>
<!-- ========= END OF TOP NAVBAR ========= -->
<HR>
<!-- ======== START OF CLASS DATA ======== -->
<H2>
<FONT SIZE="-1">
net.jot.utils</FONT>
<BR>
Class JOTUtilities</H2>
<PRE>
java.lang.Object
<IMG SRC="../../../resources/inherit.gif" ALT="extended by "><B>net.jot.utils.JOTUtilities</B>
</PRE>
<HR>
<DL>
<DT><PRE>public class <B>JOTUtilities</B><DT>extends java.lang.Object</DL>
</PRE>
<P>
Collection of small utilities which aren't worth having their own class :-)
<P>
<P>
<DL>
<DT><B>Author:</B></DT>
<DD>tcolar</DD>
</DL>
<HR>
<P>
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<A NAME="constructor_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Constructor Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../../net/jot/utils/JOTUtilities.html#JOTUtilities()">JOTUtilities</A></B>()</CODE>
<BR>
</TD>
</TR>
</TABLE>
<!-- ========== METHOD SUMMARY =========== -->
<A NAME="method_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Method Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../net/jot/utils/JOTUtilities.html#checkEmail(java.lang.String)">checkEmail</A></B>(java.lang.String email)</CODE>
<BR>
Validates wether an email address seem to be valid (ie: ~ aa@bb.cc)</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../net/jot/utils/JOTUtilities.html#checkFieldLength(java.lang.String, int)">checkFieldLength</A></B>(java.lang.String field,
int minSize)</CODE>
<BR>
Checks wether s string is at least minSize long</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../net/jot/utils/JOTUtilities.html#convertTimezone(java.util.Date, java.lang.String, boolean)">convertTimezone</A></B>(java.util.Date date,
java.lang.String destZone,
boolean dbFormat)</CODE>
<BR>
Converts a date into another timezone.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../net/jot/utils/JOTUtilities.html#copyFile(java.io.File, java.io.File)">copyFile</A></B>(java.io.File dest,
java.io.File src)</CODE>
<BR>
copy a file ...</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../net/jot/utils/JOTUtilities.html#copyFolderContent(java.io.File, java.io.File, boolean)">copyFolderContent</A></B>(java.io.File newFolder,
java.io.File oldFolder,
boolean recurse)</CODE>
<BR>
Description of the Method</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static java.io.File</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../net/jot/utils/JOTUtilities.html#createTempFile(java.lang.String, java.lang.String)">createTempFile</A></B>(java.lang.String prefix,
java.lang.String path)</CODE>
<BR>
Description of the Method</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../net/jot/utils/JOTUtilities.html#deleteFolder(java.io.File)">deleteFolder</A></B>(java.io.File folder)</CODE>
<BR>
Description of the Method</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../net/jot/utils/JOTUtilities.html#deleteFolderContent(java.io.File)">deleteFolderContent</A></B>(java.io.File root)</CODE>
<BR>
Recursively delete all the content of a folder</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../net/jot/utils/JOTUtilities.html#encodeCVSEntry(java.lang.String)">encodeCVSEntry</A></B>(java.lang.String s)</CODE>
<BR>
endode a cell of data into CVS format.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../net/jot/utils/JOTUtilities.html#endWithForwardSlash(java.lang.String)">endWithForwardSlash</A></B>(java.lang.String str)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../net/jot/utils/JOTUtilities.html#endWithSlash(java.lang.String)">endWithSlash</A></B>(java.lang.String str)</CODE>
<BR>
Return a folder path with the trailing slah</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../net/jot/utils/JOTUtilities.html#firstLine(java.lang.String)">firstLine</A></B>(java.lang.String str)</CODE>
<BR>
Description of the Method</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../net/jot/utils/JOTUtilities.html#formatDate(java.util.Date, boolean)">formatDate</A></B>(java.util.Date d,
boolean sqlFormat)</CODE>
<BR>
Formats a date into
- a user friendly format: 01/19/1977 04:08
- an SQL format: 77-01-19 04:08</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../net/jot/utils/JOTUtilities.html#formatNumber(int, int)">formatNumber</A></B>(int nb,
int length)</CODE>
<BR>
Padds an umber with 0's to make it correct length</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../net/jot/utils/JOTUtilities.html#formatString(java.lang.String, int)">formatString</A></B>(java.lang.String str,
int length)</CODE>
<BR>
Fornat a string to a specific length by truncating or padding with
spaces as needed.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../net/jot/utils/JOTUtilities.html#getFileMd5(java.io.File)">getFileMd5</A></B>(java.io.File f)</CODE>
<BR>
Computes the MD5 hash of a file's content</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../net/jot/utils/JOTUtilities.html#getFolderSize(java.io.File)">getFolderSize</A></B>(java.io.File folder)</CODE>
<BR>
get a directory size (recursively)</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../net/jot/utils/JOTUtilities.html#getSHA1Hash(java.lang.String)">getSHA1Hash</A></B>(java.lang.String input)</CODE>
<BR>
Computes an SHA1 hash as an Hex format string.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static java.io.File</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../net/jot/utils/JOTUtilities.html#getStandardTmpDir()">getStandardTmpDir</A></B>()</CODE>
<BR>
Returns java standrad tmp dir (java.io.tmpdir)</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../net/jot/utils/JOTUtilities.html#isWindowsOS()">isWindowsOS</A></B>()</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../net/jot/utils/JOTUtilities.html#isWithinFolder(java.io.File, java.io.File)">isWithinFolder</A></B>(java.io.File f,
java.io.File folder)</CODE>
<BR>
Checks if "f" is within "folder" hierarchy (recursively)
ie: if folder is an ancestor of f.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../net/jot/utils/JOTUtilities.html#lowerCase(java.lang.String)">lowerCase</A></B>(java.lang.String s)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../net/jot/utils/JOTUtilities.html#moveFile(java.io.File, java.io.File)">moveFile</A></B>(java.io.File dest,
java.io.File src)</CODE>
<BR>
Description of the Method</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../net/jot/utils/JOTUtilities.html#moveFolderContent(java.io.File, java.io.File)">moveFolderContent</A></B>(java.io.File newFolder,
java.io.File oldFolder)</CODE>
<BR>
Recursively moving all the content of a folder</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../net/jot/utils/JOTUtilities.html#replaceAll(java.lang.String, java.lang.String, java.lang.String)">replaceAll</A></B>(java.lang.String src,
java.lang.String pattern,
java.lang.String replacement)</CODE>
<BR>
Replace all occurence of "pattern" by "replacement" in the string "src"</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../net/jot/utils/JOTUtilities.html#sendRedirect(javax.servlet.http.HttpServletResponse, java.lang.String, boolean)">sendRedirect</A></B>(javax.servlet.http.HttpServletResponse res,
java.lang.String newLocation,
boolean permanent)</CODE>
<BR>
The Standard java response.sendredirect tries to rebuild the full URL using the servlet path
This will not work with java behind a proxy (since it will use the proxy path rather than vanity URL)
So here we just send a simple (possibly relative) URL.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../net/jot/utils/JOTUtilities.html#sizeIt(int, int)">sizeIt</A></B>(int i,
int length)</CODE>
<BR>
Pads a number with zeroes to make it requested length</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../net/jot/utils/JOTUtilities.html#sizeIt(java.lang.String, int)">sizeIt</A></B>(java.lang.String s,
int length)</CODE>
<BR>
Pads a string(number) with zeroes to make itt requested length</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../net/jot/utils/JOTUtilities.html#unzip(java.lang.String, java.lang.String, java.lang.String)">unzip</A></B>(java.lang.String filename,
java.lang.String tmpdir,
java.lang.String retrieve)</CODE>
<BR>
Unzip z zip file in the given folder (recursively);
Retrieve is use as this
if retrieve is set to ".swf", the last file found
ending by .swf will be returned.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../net/jot/utils/JOTUtilities.html#upperCase(java.lang.String)">upperCase</A></B>(java.lang.String s)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../net/jot/utils/JOTUtilities.html#upperFirst(java.lang.String)">upperFirst</A></B>(java.lang.String s)</CODE>
<BR>
Uppercase the first letter of a string (ie: name)</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../net/jot/utils/JOTUtilities.html#zipFolder(java.util.zip.ZipOutputStream, java.lang.String, java.io.File)">zipFolder</A></B>(java.util.zip.ZipOutputStream zos,
java.lang.String root,
java.io.File folder)</CODE>
<BR>
Recursively zip the content of a folder</TD>
</TR>
</TABLE>
<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left"><B>Methods inherited from class java.lang.Object</B></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</CODE></TD>
</TR>
</TABLE>
<P>
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<A NAME="constructor_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Constructor Detail</B></FONT></TH>
</TR>
</TABLE>
<A NAME="JOTUtilities()"><!-- --></A><H3>
JOTUtilities</H3>
<PRE>
public <B>JOTUtilities</B>()</PRE>
<DL>
</DL>
<!-- ============ METHOD DETAIL ========== -->
<A NAME="method_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Method Detail</B></FONT></TH>
</TR>
</TABLE>
<A NAME="encodeCVSEntry(java.lang.String)"><!-- --></A><H3>
encodeCVSEntry</H3>
<PRE>
public static java.lang.String <B>encodeCVSEntry</B>(java.lang.String s)</PRE>
<DL>
<DD>endode a cell of data into CVS format.
<P>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="getFolderSize(java.io.File)"><!-- --></A><H3>
getFolderSize</H3>
<PRE>
public static int <B>getFolderSize</B>(java.io.File folder)</PRE>
<DL>
<DD>get a directory size (recursively)
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>folder</CODE> - Description of the Parameter
<DT><B>Returns:</B><DD>The folderSize value</DL>
</DD>
</DL>
<HR>
<A NAME="copyFile(java.io.File, java.io.File)"><!-- --></A><H3>
copyFile</H3>
<PRE>
public static void <B>copyFile</B>(java.io.File dest,
java.io.File src)
throws java.io.FileNotFoundException,
java.io.IOException</PRE>
<DL>
<DD>copy a file ...
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>dest</CODE> - Description of Parameter<DD><CODE>src</CODE> - Description of Parameter
<DT><B>Throws:</B>
<DD><CODE>java.io.FileNotFoundException</CODE> - Description of Exception
<DD><CODE>java.io.IOException</CODE> - Description of Exception<DT><B>Since:</B></DT>
<DD></DD>
</DL>
</DD>
</DL>
<HR>
<A NAME="formatString(java.lang.String, int)"><!-- --></A><H3>
formatString</H3>
<PRE>
public static java.lang.String <B>formatString</B>(java.lang.String str,
int length)</PRE>
<DL>
<DD>Fornat a string to a specific length by truncating or padding with
spaces as needed.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>str</CODE> - Description of Parameter<DD><CODE>length</CODE> - Description of Parameter
<DT><B>Returns:</B><DD>Description of the Returned Value<DT><B>Since:</B></DT>
<DD></DD>
</DL>
</DD>
</DL>
<HR>
<A NAME="firstLine(java.lang.String)"><!-- --></A><H3>
firstLine</H3>
<PRE>
public static java.lang.String <B>firstLine</B>(java.lang.String str)</PRE>
<DL>
<DD>Description of the Method
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>str</CODE> - Description of Parameter
<DT><B>Returns:</B><DD>Description of the Returned Value</DL>
</DD>
</DL>
<HR>
<A NAME="endWithSlash(java.lang.String)"><!-- --></A><H3>
endWithSlash</H3>
<PRE>
public static java.lang.String <B>endWithSlash</B>(java.lang.String str)</PRE>
<DL>
<DD>Return a folder path with the trailing slah
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>str</CODE> - Description of Parameter
<DT><B>Returns:</B><DD>Description of the Returned Value</DL>
</DD>
</DL>
<HR>
<A NAME="endWithForwardSlash(java.lang.String)"><!-- --></A><H3>
endWithForwardSlash</H3>
<PRE>
public static java.lang.String <B>endWithForwardSlash</B>(java.lang.String str)</PRE>
<DL>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="moveFile(java.io.File, java.io.File)"><!-- --></A><H3>
moveFile</H3>
<PRE>
public static void <B>moveFile</B>(java.io.File dest,
java.io.File src)
throws java.io.FileNotFoundException,
java.io.IOException</PRE>
<DL>
<DD>Description of the Method
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>dest</CODE> - Description of Parameter<DD><CODE>src</CODE> - Description of Parameter
<DT><B>Throws:</B>
<DD><CODE>java.io.FileNotFoundException</CODE> - Description of Exception
<DD><CODE>java.io.IOException</CODE> - Description of Exception</DL>
</DD>
</DL>
<HR>
<A NAME="deleteFolder(java.io.File)"><!-- --></A><H3>
deleteFolder</H3>
<PRE>
public static void <B>deleteFolder</B>(java.io.File folder)</PRE>
<DL>
<DD>Description of the Method
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>folder</CODE> - Description of the Parameter</DL>
</DD>
</DL>
<HR>
<A NAME="deleteFolderContent(java.io.File)"><!-- --></A><H3>
deleteFolderContent</H3>
<PRE>
public static void <B>deleteFolderContent</B>(java.io.File root)</PRE>
<DL>
<DD>Recursively delete all the content of a folder
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>root</CODE> - Description of Parameter</DL>
</DD>
</DL>
<HR>
<A NAME="copyFolderContent(java.io.File, java.io.File, boolean)"><!-- --></A><H3>
copyFolderContent</H3>
<PRE>
public static void <B>copyFolderContent</B>(java.io.File newFolder,
java.io.File oldFolder,
boolean recurse)
throws java.lang.Exception</PRE>
<DL>
<DD>Description of the Method
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>newFolder</CODE> - Description of Parameter<DD><CODE>oldFolder</CODE> - Description of Parameter
<DT><B>Throws:</B>
<DD><CODE>java.lang.Exception</CODE> - Description of the Exception</DL>
</DD>
</DL>
<HR>
<A NAME="moveFolderContent(java.io.File, java.io.File)"><!-- --></A><H3>
moveFolderContent</H3>
<PRE>
public static void <B>moveFolderContent</B>(java.io.File newFolder,
java.io.File oldFolder)</PRE>
<DL>
<DD>Recursively moving all the content of a folder
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>newFolder</CODE> - Description of Parameter<DD><CODE>oldFolder</CODE> - Description of Parameter</DL>
</DD>
</DL>
<HR>
<A NAME="zipFolder(java.util.zip.ZipOutputStream, java.lang.String, java.io.File)"><!-- --></A><H3>
zipFolder</H3>
<PRE>
public static void <B>zipFolder</B>(java.util.zip.ZipOutputStream zos,
java.lang.String root,
java.io.File folder)
throws java.io.IOException</PRE>
<DL>
<DD>Recursively zip the content of a folder
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>zos</CODE> - Description of Parameter<DD><CODE>root</CODE> - Description of Parameter<DD><CODE>folder</CODE> - Description of Parameter
<DT><B>Throws:</B>
<DD><CODE>java.io.IOException</CODE> - Description of Exception</DL>
</DD>
</DL>
<HR>
<A NAME="unzip(java.lang.String, java.lang.String, java.lang.String)"><!-- --></A><H3>
unzip</H3>
<PRE>
public static java.lang.String <B>unzip</B>(java.lang.String filename,
java.lang.String tmpdir,
java.lang.String retrieve)
throws java.lang.Exception</PRE>
<DL>
<DD>Unzip z zip file in the given folder (recursively);
Retrieve is use as this
if retrieve is set to ".swf", the last file found
ending by .swf will be returned.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>tmpdir</CODE> - Description of the Parameter<DD><CODE>retrieve</CODE> - Description of the Parameter<DD><CODE>filename</CODE> - Description of the Parameter
<DT><B>Returns:</B><DD>Description of the Return Value
<DT><B>Throws:</B>
<DD><CODE>java.lang.Exception</CODE> - Description of the Exception</DL>
</DD>
</DL>
<HR>
<A NAME="replaceAll(java.lang.String, java.lang.String, java.lang.String)"><!-- --></A><H3>
replaceAll</H3>
<PRE>
public static java.lang.String <B>replaceAll</B>(java.lang.String src,
java.lang.String pattern,
java.lang.String replacement)</PRE>
<DL>
<DD>Replace all occurence of "pattern" by "replacement" in the string "src"
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>src</CODE> - Description of the Parameter<DD><CODE>pattern</CODE> - Description of the Parameter<DD><CODE>replacement</CODE> - Description of the Parameter
<DT><B>Returns:</B><DD>Description of the Return Value</DL>
</DD>
</DL>
<HR>
<A NAME="createTempFile(java.lang.String, java.lang.String)"><!-- --></A><H3>
createTempFile</H3>
<PRE>
public static java.io.File <B>createTempFile</B>(java.lang.String prefix,
java.lang.String path)</PRE>
<DL>
<DD>Description of the Method
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>prefix</CODE> - Description of the Parameter
<DT><B>Returns:</B><DD>Description of the Return Value</DL>
</DD>
</DL>
<HR>
<A NAME="formatDate(java.util.Date, boolean)"><!-- --></A><H3>
formatDate</H3>
<PRE>
public static java.lang.String <B>formatDate</B>(java.util.Date d,
boolean sqlFormat)</PRE>
<DL>
<DD>Formats a date into
- a user friendly format: 01/19/1977 04:08
- an SQL format: 77-01-19 04:08
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>d</CODE> - <DD><CODE>sqlFormat</CODE> -
<DT><B>Returns:</B><DD></DL>
</DD>
</DL>
<HR>
<A NAME="sizeIt(int, int)"><!-- --></A><H3>
sizeIt</H3>
<PRE>
public static java.lang.String <B>sizeIt</B>(int i,
int length)</PRE>
<DL>
<DD>Pads a number with zeroes to make it requested length
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>i</CODE> - <DD><CODE>length</CODE> -
<DT><B>Returns:</B><DD></DL>
</DD>
</DL>
<HR>
<A NAME="sizeIt(java.lang.String, int)"><!-- --></A><H3>
sizeIt</H3>
<PRE>
public static java.lang.String <B>sizeIt</B>(java.lang.String s,
int length)</PRE>
<DL>
<DD>Pads a string(number) with zeroes to make itt requested length
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>s</CODE> - <DD><CODE>length</CODE> -
<DT><B>Returns:</B><DD></DL>
</DD>
</DL>
<HR>
<A NAME="checkFieldLength(java.lang.String, int)"><!-- --></A><H3>
checkFieldLength</H3>
<PRE>
public static boolean <B>checkFieldLength</B>(java.lang.String field,
int minSize)</PRE>
<DL>
<DD>Checks wether s string is at least minSize long
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>field</CODE> - <DD><CODE>minSize</CODE> -
<DT><B>Returns:</B><DD></DL>
</DD>
</DL>
<HR>
<A NAME="checkEmail(java.lang.String)"><!-- --></A><H3>
checkEmail</H3>
<PRE>
public static boolean <B>checkEmail</B>(java.lang.String email)</PRE>
<DL>
<DD>Validates wether an email address seem to be valid (ie: ~ aa@bb.cc)
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>email</CODE> -
<DT><B>Returns:</B><DD></DL>
</DD>
</DL>
<HR>
<A NAME="upperCase(java.lang.String)"><!-- --></A><H3>
upperCase</H3>
<PRE>
public static java.lang.String <B>upperCase</B>(java.lang.String s)</PRE>
<DL>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="lowerCase(java.lang.String)"><!-- --></A><H3>
lowerCase</H3>
<PRE>
public static java.lang.String <B>lowerCase</B>(java.lang.String s)</PRE>
<DL>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="upperFirst(java.lang.String)"><!-- --></A><H3>
upperFirst</H3>
<PRE>
public static java.lang.String <B>upperFirst</B>(java.lang.String s)</PRE>
<DL>
<DD>Uppercase the first letter of a string (ie: name)
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>s</CODE> -
<DT><B>Returns:</B><DD></DL>
</DD>
</DL>
<HR>
<A NAME="convertTimezone(java.util.Date, java.lang.String, boolean)"><!-- --></A><H3>
convertTimezone</H3>
<PRE>
public static java.lang.String <B>convertTimezone</B>(java.util.Date date,
java.lang.String destZone,
boolean dbFormat)</PRE>
<DL>
<DD>Converts a date into another timezone.
TODO: not sure that works - needs testing.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>date</CODE> - <DD><CODE>destZone</CODE> - <DD><CODE>dbFormat</CODE> -
<DT><B>Returns:</B><DD></DL>
</DD>
</DL>
<HR>
<A NAME="isWindowsOS()"><!-- --></A><H3>
isWindowsOS</H3>
<PRE>
public static boolean <B>isWindowsOS</B>()</PRE>
<DL>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="formatNumber(int, int)"><!-- --></A><H3>
formatNumber</H3>
<PRE>
public static java.lang.String <B>formatNumber</B>(int nb,
int length)</PRE>
<DL>
<DD>Padds an umber with 0's to make it correct length
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>nb</CODE> - <DD><CODE>length</CODE> -
<DT><B>Returns:</B><DD></DL>
</DD>
</DL>
<HR>
<A NAME="sendRedirect(javax.servlet.http.HttpServletResponse, java.lang.String, boolean)"><!-- --></A><H3>
sendRedirect</H3>
<PRE>
public static void <B>sendRedirect</B>(javax.servlet.http.HttpServletResponse res,
java.lang.String newLocation,
boolean permanent)</PRE>
<DL>
<DD>The Standard java response.sendredirect tries to rebuild the full URL using the servlet path
This will not work with java behind a proxy (since it will use the proxy path rather than vanity URL)
So here we just send a simple (possibly relative) URL.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>res</CODE> - <DD><CODE>newLocation</CODE> - <DD><CODE>permanent</CODE> - </DL>
</DD>
</DL>
<HR>
<A NAME="getSHA1Hash(java.lang.String)"><!-- --></A><H3>
getSHA1Hash</H3>
<PRE>
public static java.lang.String <B>getSHA1Hash</B>(java.lang.String input)
throws java.lang.Exception</PRE>
<DL>
<DD>Computes an SHA1 hash as an Hex format string.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>input</CODE> -
<DT><B>Returns:</B><DD>
<DT><B>Throws:</B>
<DD><CODE>java.lang.Exception</CODE></DL>
</DD>
</DL>
<HR>
<A NAME="isWithinFolder(java.io.File, java.io.File)"><!-- --></A><H3>
isWithinFolder</H3>
<PRE>
public static boolean <B>isWithinFolder</B>(java.io.File f,
java.io.File folder)</PRE>
<DL>
<DD>Checks if "f" is within "folder" hierarchy (recursively)
ie: if folder is an ancestor of f.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>f</CODE> - <DD><CODE>folder</CODE> -
<DT><B>Returns:</B><DD></DL>
</DD>
</DL>
<HR>
<A NAME="getStandardTmpDir()"><!-- --></A><H3>
getStandardTmpDir</H3>
<PRE>
public static java.io.File <B>getStandardTmpDir</B>()</PRE>
<DL>
<DD>Returns java standrad tmp dir (java.io.tmpdir)
<P>
<DD><DL>
<DT><B>Returns:</B><DD></DL>
</DD>
</DL>
<HR>
<A NAME="getFileMd5(java.io.File)"><!-- --></A><H3>
getFileMd5</H3>
<PRE>
public static java.lang.String <B>getFileMd5</B>(java.io.File f)
throws java.lang.Exception</PRE>
<DL>
<DD>Computes the MD5 hash of a file's content
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>f</CODE> -
<DT><B>Returns:</B><DD>
<DT><B>Throws:</B>
<DD><CODE>java.lang.Exception</CODE></DL>
</DD>
</DL>
<!-- ========= END OF CLASS DATA ========= -->
<HR>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<A NAME="navbar_bottom"><!-- --></A>
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../net/jot/utils/JOTHTMLUtilities.html" title="class in net.jot.utils"><B>PREV CLASS</B></A>
NEXT CLASS</FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../index.html?net/jot/utils/JOTUtilities.html" target="_top"><B>FRAMES</B></A>
<A HREF="JOTUtilities.html" target="_top"><B>NO FRAMES</B></A>
<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY: NESTED | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<HR>
</BODY>
</HTML>