days old
+ * or older. This has the potential to be a heavy call - it has to do
+ * complete directory listing and then recursively delete the files and
+ * directories as needed.
*
- * Note: this method has not been tested as it is rather hard to write a junit test for!
+ * Note: this method has not been tested as it is rather hard to write a
+ * junit test for!
*
* @param directories
* @return number of directories deleted
@@ -544,10 +577,11 @@
* List files in temp directory older than numDays.
*
* @param numDays
- * Number of days old that the directory should be to be deleted. Must be greater than 0
+ * Number of days old that the directory should be to be deleted.
+ * Must be greater than 0
* @return array of files older than input date
* @throws FileUtilException
- * if numDays <= 0
+ * if numDays <= 0
*/
public static File[] getOldTempFiles(int numDays) throws FileUtilException {
// Contract checking
@@ -618,8 +652,9 @@
}
/**
- * Encode a filename in such a way that the UTF-8 characters won't be munged during the download by a browser. Need
- * the request to work out the user's browser type
+ * Encode a filename in such a way that the UTF-8 characters won't be munged
+ * during the download by a browser. Need the request to work out the user's
+ * browser type
*
* @return encoded filename
* @throws UnsupportedEncodingException
@@ -663,13 +698,14 @@
}
/**
- * Call xstream to get the POJOs from the XML file. To make it backwardly compatible we catch any exceptions due to
- * added fields, remove the field using the ToolContentVersionFilter functionality and try to reparse. We can't
- * nominate the problem fields in advance as we are making XML created by newer versions of LAMS compatible with an
- * older version.
+ * Call xstream to get the POJOs from the XML file. To make it backwardly
+ * compatible we catch any exceptions due to added fields, remove the field
+ * using the ToolContentVersionFilter functionality and try to reparse. We
+ * can't nominate the problem fields in advance as we are making XML created
+ * by newer versions of LAMS compatible with an older version.
*
- * This logic depends on the exception message containing the text. When we upgrade xstream, we must check that this
- * message doesn't change.
+ * This logic depends on the exception message containing the text. When we
+ * upgrade xstream, we must check that this message doesn't change.
*
*
* com.thoughtworks.xstream.converters.ConversionException: unknownField : unknownField
@@ -787,21 +823,24 @@
* Exports data in MS Excel (.xls) format.
*
* @param out
- * output stream to which the file written; usually taken from HTTP response; it is not closed
- * afterwards
+ * output stream to which the file written; usually taken from
+ * HTTP response; it is not closed afterwards
* @param sheetName
- * name of first sheet in Excel workbook; data will be stored in this sheet
+ * name of first sheet in Excel workbook; data will be stored in
+ * this sheet
* @param title
- * title printed in the first (0,0) cell
+ * title printed in the first (0,0) cell
* @param dateHeader
- * text describing current date; if NULL
then no date is printed; if not
- * NULL
then text is written out along with current date in the cell; the date is
- * formatted according to {@link #EXPORT_TO_SPREADSHEET_TITLE_DATE_FORMAT}
+ * text describing current date; if NULL
then no
+ * date is printed; if not NULL
then text is written
+ * out along with current date in the cell; the date is formatted
+ * according to {@link #EXPORT_TO_SPREADSHEET_TITLE_DATE_FORMAT}
* @param columnNames
- * name of the columns that describe data
parameter
+ * name of the columns that describe data
parameter
* @param data
- * array of data to print out; first index of array describes a row, second a column; dates are
- * formatted according to {@link #EXPORT_TO_SPREADSHEET_CELL_DATE_FORMAT}
+ * array of data to print out; first index of array describes a
+ * row, second a column; dates are formatted according to
+ * {@link #EXPORT_TO_SPREADSHEET_CELL_DATE_FORMAT}
* @throws IOException
* @throws JXLException
*/
@@ -861,22 +900,25 @@
}
/**
- * Exports data in CSV format. It uses UTF-8 character set and semicolon as separator.
+ * Exports data in CSV format. It uses UTF-8 character set and semicolon as
+ * separator.
*
* @param out
- * output stream to which the file written; usually taken from HTTP response; it is not closed
- * afterwards
+ * output stream to which the file written; usually taken from
+ * HTTP response; it is not closed afterwards
* @param title
- * title printed in the first (0,0) cell
+ * title printed in the first (0,0) cell
* @param dateHeader
- * text describing current date; if NULL
then no date is printed; if not
- * NULL
then text is written out along with current date in the cell; the date is
- * formatted according to {@link #EXPORT_TO_SPREADSHEET_TITLE_DATE_FORMAT}
+ * text describing current date; if NULL
then no
+ * date is printed; if not NULL
then text is written
+ * out along with current date in the cell; the date is formatted
+ * according to {@link #EXPORT_TO_SPREADSHEET_TITLE_DATE_FORMAT}
* @param columnNames
- * name of the columns that describe data
parameter
+ * name of the columns that describe data
parameter
* @param data
- * array of data to print out; first index of array describes a row, second a column; dates are
- * formatted according to {@link #EXPORT_TO_SPREADSHEET_CELL_DATE_FORMAT}
+ * array of data to print out; first index of array describes a
+ * row, second a column; dates are formatted according to
+ * {@link #EXPORT_TO_SPREADSHEET_CELL_DATE_FORMAT}
* @throws IOException
*/
public static void exportToolToCSV(OutputStream out, String title, String dateHeader, String[] columnNames,