Package org.javlo.utils
Class XLSTools
- java.lang.Object
-
- org.javlo.utils.XLSTools
-
public class XLSTools extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static String
REQUEST_ATTRIBUTE_KEY
static String
TYPE
-
Constructor Summary
Constructors Constructor Description XLSTools()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static String
cleanSheetName(String sheetName)
static Cell[][]
createArray(int x, int y)
static Cell[][]
getArray(ContentContext ctx, File file)
static Cell[][]
getArray(ContentContext ctx, File file, String sheetNames)
static Cell[][]
getArray(ContentContext ctx, URL url)
static Cell[][]
getArray(ContentContext ctx, URL url, String sheetNames)
static Map<String,Cell[][]>
getArrayXSLXAllSheet(ContentContext ctx, InputStream in)
static Cell[][]
getCellArray(String[][] array)
protected static Collection<String>
getExcelSheets(File xslxFile)
static List<Map<String,Cell>>
getItems(ContentContext ctx, Cell[][] data)
protected static Cell[][]
getXLSArray(ContentContext ctx, File xslxFile, String sheetName)
static Cell[][]
getXLSXArray(ContentContext ctx, File xslxFile, String sheetName)
static Cell[][]
getXLSXArray(ContentContext ctx, InputStream in, String sheetName)
static void
main(String[] args)
protected static String
renderCell(String content)
static void
structureExcelSheetOnCol(File excelFile, String referenceColomn, OutputStream out)
link all scheet with "synchroCol" col as referentstatic void
test()
static void
test2()
static void
writeXLS(Cell[][] array, OutputStream out)
static void
writeXLSX(Map<String,Cell[][]> arrays, File file)
static void
writeXLSX(Map<String,Cell[][]> arrays, OutputStream out)
static void
writeXLSX(Cell[][] array, File out)
static void
writeXLSX(Cell[][] array, OutputStream out)
static void
writeXLSX(Cell[][] array, OutputStream out, File sourceFile, String sheetName)
-
-
-
Field Detail
-
REQUEST_ATTRIBUTE_KEY
public static final String REQUEST_ATTRIBUTE_KEY
- See Also:
- Constant Field Values
-
TYPE
public static final String TYPE
- See Also:
- Constant Field Values
-
-
Method Detail
-
getArray
public static Cell[][] getArray(ContentContext ctx, File file) throws Exception
- Throws:
Exception
-
getArray
public static Cell[][] getArray(ContentContext ctx, URL url) throws Exception
- Throws:
Exception
-
getArray
public static Cell[][] getArray(ContentContext ctx, URL url, String sheetNames) throws Exception
- Throws:
Exception
-
getArray
public static Cell[][] getArray(ContentContext ctx, File file, String sheetNames) throws Exception
- Throws:
Exception
-
getXLSXArray
public static Cell[][] getXLSXArray(ContentContext ctx, File xslxFile, String sheetName) throws Exception
- Throws:
Exception
-
getArrayXSLXAllSheet
public static Map<String,Cell[][]> getArrayXSLXAllSheet(ContentContext ctx, InputStream in) throws IOException
- Throws:
IOException
-
getXLSXArray
public static Cell[][] getXLSXArray(ContentContext ctx, InputStream in, String sheetName) throws Exception
- Throws:
Exception
-
getExcelSheets
protected static Collection<String> getExcelSheets(File xslxFile) throws Exception
- Throws:
Exception
-
structureExcelSheetOnCol
public static void structureExcelSheetOnCol(File excelFile, String referenceColomn, OutputStream out) throws Exception
link all scheet with "synchroCol" col as referent- Parameters:
excelFile
-referenceColomn
- , the title of the column with linked code between line if different sheet.- Throws:
Exception
-
getXLSArray
protected static Cell[][] getXLSArray(ContentContext ctx, File xslxFile, String sheetName) throws Exception
- Throws:
Exception
-
writeXLS
public static void writeXLS(Cell[][] array, OutputStream out) throws IOException
- Throws:
IOException
-
writeXLSX
public static void writeXLSX(Cell[][] array, File out) throws IOException
- Throws:
IOException
-
writeXLSX
public static void writeXLSX(Cell[][] array, OutputStream out) throws IOException
- Throws:
IOException
-
writeXLSX
public static void writeXLSX(Map<String,Cell[][]> arrays, File file) throws IOException
- Throws:
IOException
-
writeXLSX
public static void writeXLSX(Map<String,Cell[][]> arrays, OutputStream out) throws IOException
- Throws:
IOException
-
writeXLSX
public static void writeXLSX(Cell[][] array, OutputStream out, File sourceFile, String sheetName) throws IOException
- Throws:
IOException
-
-