* preserve nodes set to true.
*
* @throws IOException if the stream cannot be read
+ * @throws RuntimeException a number of runtime exceptions can be thrown, especially if there are problems with the
+ * input format
* @see #HSSFWorkbook(POIFSFileSystem, boolean)
* @see POIFSFileSystem
*/
* need to. If set, will store all of the POIFSFileSystem
* in memory
* @throws IOException if the stream cannot be read
+ * @throws RuntimeException a number of runtime exceptions can be thrown, especially if there are problems with the
+ * input format
* @see POIFSFileSystem
*/
public HSSFWorkbook(POIFSFileSystem fs, boolean preserveNodes)
* need to. If set, will store all of the POIFSFileSystem
* in memory
* @throws IOException if the stream cannot be read
+ * @throws RuntimeException a number of runtime exceptions can be thrown, especially if there are problems with the
+ * input format
* @see POIFSFileSystem
*/
public HSSFWorkbook(DirectoryNode directory, POIFSFileSystem fs, boolean preserveNodes)
* need to. If set, will store all of the POIFSFileSystem
* in memory
* @throws IOException if the stream cannot be read
+ * @throws RuntimeException a number of runtime exceptions can be thrown, especially if there are problems with the
+ * input format
* @see POIFSFileSystem
*/
public HSSFWorkbook(DirectoryNode directory, boolean preserveNodes)
* preserve nodes set to true.
*
* @throws IOException if the stream cannot be read
+ * @throws RuntimeException a number of runtime exceptions can be thrown, especially if there are problems with the
+ * input format
* @see #HSSFWorkbook(InputStream, boolean)
* @see #HSSFWorkbook(POIFSFileSystem)
* @see POIFSFileSystem
* macros. This takes more memory, so only say yes if you
* need to.
* @throws IOException if the stream cannot be read
+ * @throws RuntimeException a number of runtime exceptions can be thrown, especially if there are problems with the
+ * input format
* @see POIFSFileSystem
* @see #HSSFWorkbook(POIFSFileSystem)
*/
* @return The created workbook
*
* @throws IOException if an error occurs while creating the objects
+ * @throws RuntimeException a number of other runtime exceptions can be thrown, especially if there are problems with the
+ * input format
*/
public static Workbook create(boolean xssf) throws IOException {
return wp(xssf ? FileMagic.OOXML : FileMagic.OLE2, WorkbookProvider::create);
* @return The created workbook
*
* @throws IOException if an error occurs while reading the data
+ * @throws RuntimeException a number of runtime exceptions can be thrown, especially if there are problems with the
+ * input format
*/
public static Workbook create(POIFSFileSystem fs) throws IOException {
return create(fs, null);
* @return The created Workbook
*
* @throws IOException if an error occurs while reading the data
+ * @throws RuntimeException a number of runtime exceptions can be thrown, especially if there are problems with the
+ * input format
*/
private static Workbook create(final POIFSFileSystem fs, String password) throws IOException {
return create(fs.getRoot(), password);
* @return The created Workbook
*
* @throws IOException if an error occurs while reading the data
+ * @throws RuntimeException a number of other exceptions can be thrown, especially if there are problems with the
+ * input format
*/
public static Workbook create(final DirectoryNode root) throws IOException {
return create(root, null);
* @return The created Workbook
*
* @throws IOException if an error occurs while reading the data
+ * @throws RuntimeException a number of runtime exceptions can be thrown, especially if there are problems with the
+ * input format
*/
public static Workbook create(final DirectoryNode root, String password) throws IOException {
// Encrypted OOXML files go inside OLE2 containers, is this one?
* @throws IOException if an error occurs while reading the data
* @throws EncryptedDocumentException If the Workbook given is password protected
* @throws EmptyFileException If the given data is empty
+ * @throws RuntimeException a number of other runtime exceptions can be thrown, especially if there are problems with the
+ * input format
*/
public static Workbook create(InputStream inp) throws IOException, EncryptedDocumentException {
return create(inp, null);
* @throws IOException if an error occurs while reading the data
* @throws EncryptedDocumentException If the wrong password is given for a protected file
* @throws EmptyFileException If the given data is empty
+ * @throws RuntimeException a number of other runtime exceptions can be thrown, especially if there are problems with the
+ * input format
*/
public static Workbook create(InputStream inp, String password) throws IOException, EncryptedDocumentException {
InputStream is = FileMagic.prepareToCheckMagic(inp);
* @throws IOException if an error occurs while reading the data
* @throws EncryptedDocumentException If the Workbook given is password protected
* @throws EmptyFileException If the given data is empty
+ * @throws RuntimeException a number of other runtime exceptions can be thrown, especially if there are problems with the
+ * input format
*/
public static Workbook create(File file) throws IOException, EncryptedDocumentException {
return create(file, null);
* @throws IOException if an error occurs while reading the data
* @throws EncryptedDocumentException If the wrong password is given for a protected file
* @throws EmptyFileException If the given data is empty
+ * @throws RuntimeException a number of other runtime exceptions can be thrown, especially if there are problems with the
+ * input format
*/
public static Workbook create(File file, String password) throws IOException, EncryptedDocumentException {
return create(file, password, false);
* @throws IOException if an error occurs while reading the data
* @throws EncryptedDocumentException If the wrong password is given for a protected file
* @throws EmptyFileException If the given data is empty
+ * @throws RuntimeException a number of other runtime exceptions can be thrown, especially if there are problems with the
+ * input format
*/
public static Workbook create(File file, String password, boolean readOnly) throws IOException, EncryptedDocumentException {
if (!file.exists()) {