com.extentech.ExtenXLS
Class EncryptedWorkBookHandle

java.lang.Object
  extended by com.extentech.ExtenXLS.DocumentHandle
      extended by com.extentech.ExtenXLS.WorkBookHandle
          extended by com.extentech.ExtenXLS.EncryptedWorkBookHandle
All Implemented Interfaces:
Document, Handle, WorkBook

public class EncryptedWorkBookHandle
extends WorkBookHandle

EncryptedWorkBookHandle is a WorkBookHandle that manages encrypted files. These files must be in Excel2007 + encrypted format. Earlier versions of encrypted files will not be openable within this class Passwords are required to open EncryptedWorkBooks, and if not re-set they will save as encrypted files utilizing the same password that they were opened tos


Field Summary
 
Fields inherited from class com.extentech.ExtenXLS.WorkBookHandle
CONVERTMULBLANKS
 
Fields inherited from interface com.extentech.ExtenXLS.WorkBook
ALLOWDUPES, CALCULATE_ALWAYS, CALCULATE_AUTO, CALCULATE_EXPLICIT, DEBUG_HIGH, DEBUG_LOW, DEBUG_MEDIUM, SHAREDUPES, STRING_ENCODING_AUTO, STRING_ENCODING_COMPRESSED, STRING_ENCODING_UNICODE
 
Constructor Summary
EncryptedWorkBookHandle(InputStream encryptedBook, String password)
          Create a new WorkBookHandle from the byte array passed in.
EncryptedWorkBookHandle(String password)
          Default constructor creates a new, empty EncryptedWorkBookHandle with a password set for saveEncrypted functionality 3 WorkSheets: "Sheet1","Sheet2",and "Sheet3".
 
Method Summary
static void writeAndEncrypt(WorkBookHandle book, OutputStream out, String password)
          Write a workbook in 128 bit encryption to the OutputStream provided.
 void writeEncrypted(OutputStream out)
          Write a workbook in 128 bit encryption to the OutputStream provided.
 void writeEncrypted(OutputStream out, String password)
          Write a workbook in 128 bit encryption to the OutputStream provided.
 
Methods inherited from class com.extentech.ExtenXLS.WorkBookHandle
addSheetFromWorkBook, addSheetFromWorkBookWithFormatting, addWorkSheet, addWorkSheet, calculateFormulas, copyChartToSheet, copyChartToSheet, copyWorkSheet, createChart, createNamedRange, createWorkSheet, createWorkSheet, deleteChart, forceRecalc, getAllStrings, getBytes, getCell, getCellRanges, getCells, getChart, getChartById, getCharts, getConditionalFormats, getFormats, getFormulaCalculationMode, getFormulaHandle, getImage, getImages, getIsExcel2007, getName, getNamedRange, getNamedRangeInScope, getNamedRanges, getNamedRangesInScope, getNoSheetWorkBook, getNumCells, getNumWorkSheets, getPivotTable, getPivotTables, getStats, getStats, getWorkBook, getWorkSheet, getWorkSheet, getWorkSheets, getXLSVersionString, is1904, recalc, removeAllWorkSheets, searchAndReplace, setDefaultColWidth, setDefaultRowHeight, setDupeStringMode, setFormulaCalculationMode, setProtected, setShowSheetTabs, setStringEncodingMode, showSheetTabs, write, write, write, write, writeBytes, writeXLSXBytes
 
Methods inherited from class com.extentech.ExtenXLS.DocumentHandle
addProperty, close, finalize, getFactory, getProperties, getProperty, getVersion, getWorkingDirectory, reset, setDebugLevel, setName, setProperties, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.extentech.ExtenXLS.WorkBook
addProperty, getProperty, getWorkingDirectory, reset, setDebugLevel, setName, toString
 

Constructor Detail

EncryptedWorkBookHandle

public EncryptedWorkBookHandle(String password)
Default constructor creates a new, empty EncryptedWorkBookHandle with a password set for saveEncrypted functionality 3 WorkSheets: "Sheet1","Sheet2",and "Sheet3".


EncryptedWorkBookHandle

public EncryptedWorkBookHandle(InputStream encryptedBook,
                               String password)
                        throws com.extentech.formats.XLS.WorkBookException
Create a new WorkBookHandle from the byte array passed in. InputStream passed in must contain a valid xls or xlsx workbook file

Parameters:
encryptedBook - - InputStream containing the valid XLS or XLSX file for reading
Throws:
WorkBookException - if the inputstream cannot be parsed correctly. Note the error codes provided in WorkBookException can detail if password is incorrect, if file is corrupt, etc.
com.extentech.formats.XLS.WorkBookException
Method Detail

writeEncrypted

public void writeEncrypted(OutputStream out,
                           String password)
                    throws com.extentech.formats.XLS.WorkBookException
Write a workbook in 128 bit encryption to the OutputStream provided. For more control over encryption, please utilize the extentech.crypto.mscrypto.MSOfficeEncryption classes

Parameters:
out -
password - = new password to set to the encrypted workbook
Throws:
com.extentech.formats.XLS.WorkBookException

writeAndEncrypt

public static void writeAndEncrypt(WorkBookHandle book,
                                   OutputStream out,
                                   String password)
                            throws com.extentech.formats.XLS.WorkBookException
Write a workbook in 128 bit encryption to the OutputStream provided. For more control over encryption, please utilize the extentech.crypto.mscrypto.MSOfficeEncryption classes

Parameters:
out -
password - = new password to set to the encrypted workbook
Throws:
com.extentech.formats.XLS.WorkBookException

writeEncrypted

public void writeEncrypted(OutputStream out)
                    throws com.extentech.formats.XLS.WorkBookException
Write a workbook in 128 bit encryption to the OutputStream provided. For more control over encryption, please utilize the extentech.crypto.mscrypto.MSOfficeEncryption classes File will be written utilizing the same password it was opened with

Parameters:
out -
password -
Throws:
com.extentech.formats.XLS.WorkBookException


Copyright © 2010 Extentech Inc. All Rights Reserved.