Examples of PasswordRecord


Examples of org.apache.poi.hssf.record.PasswordRecord

  /**
   * creates a Password record with password set to 0x0000.
   */
  private static PasswordRecord createPassword() {
    return new PasswordRecord(0x0000);
  }
View Full Code Here

Examples of org.apache.poi.hssf.record.PasswordRecord

    /**
     * @return a new Password record with password set to 0x0000 (no password).
     */
    private static PasswordRecord createPassword() {
        return new PasswordRecord(0x0000); // no password by default!
    }
View Full Code Here

Examples of org.apache.poi.hssf.record.PasswordRecord

     */
    private static PasswordRecord createPassword() {
        if (log.check( POILogger.DEBUG )) {
            log.log(POILogger.DEBUG, "create password record with 00 password");
        }
        PasswordRecord retval = new PasswordRecord();

        retval.setPassword((short)00);
        return retval;
    }
View Full Code Here

Examples of org.apache.poi.hssf.record.PasswordRecord

     * @param scenarios are protected
     */
    public void protectSheet( String password, boolean objects, boolean scenarios ) {
        int protIdx = -1;
        ProtectRecord prec = getProtect();
        PasswordRecord pass = getPassword();
        prec.setProtect(true);
        pass.setPassword(PasswordRecord.hashPassword(password));
        if((objprotect == null && objects) || (scenprotect != null && scenarios)) {
            protIdx = records.indexOf( protect );
        }
        if(objprotect == null && objects) {
            ObjectProtectRecord rec = createObjectProtect();
View Full Code Here

Examples of org.apache.poi.hssf.record.PasswordRecord

    public void unprotectSheet( boolean sheet, boolean objects, boolean scenarios ) {

        if (!sheet) {
           ProtectRecord prec = getProtect();
           prec.setProtect(sheet);
           PasswordRecord pass = getPassword();
           pass.setPassword((short)00);
        }
        if(objprotect != null && !objects) {
            objprotect.setProtect(false);
        }
        if(scenprotect != null && !scenarios) {
View Full Code Here

Examples of org.apache.poi.hssf.record.PasswordRecord

  HSSFWorkbook wb = new HSSFWorkbook();
        HSSFSheet s = wb.createSheet();
        s.protectSheet("abcdefghij");
        Sheet sheet = s.getSheet();
  ProtectRecord protect = sheet.getProtect();
  PasswordRecord pass = sheet.getPassword();
        assertTrue("protection should be on",protect.getProtect());
        assertTrue("object protection should be on",sheet.isProtected()[1]);
        assertTrue("scenario protection should be on",sheet.isProtected()[2]);
        assertEquals("well known value for top secret hash should be "+Integer.toHexString(expected).substring(4),expected,pass.getPassword());
    }
View Full Code Here

Examples of org.apache.poi.hssf.record.PasswordRecord

    /**
     * creates a Password record with password set to 0x0000.
     */
    private static PasswordRecord createPassword() {
        return new PasswordRecord(0x0000);
    }
View Full Code Here

Examples of org.apache.poi.hssf.record.PasswordRecord

     * @param scenarios are protected
     */
    public void protectSheet( String password, boolean objects, boolean scenarios ) {
        int protIdx = -1;
        ProtectRecord prec = getProtect();
        PasswordRecord pass = getPassword();
        prec.setProtect(true);
        pass.setPassword(PasswordRecord.hashPassword(password));
        if((objprotect == null && objects) || (scenprotect != null && scenarios)) {
            protIdx = records.indexOf( protect );
        }
        if(objprotect == null && objects) {
            ObjectProtectRecord rec = createObjectProtect();
View Full Code Here

Examples of org.apache.poi.hssf.record.PasswordRecord

    public void unprotectSheet( boolean sheet, boolean objects, boolean scenarios ) {

        if (!sheet) {
           ProtectRecord prec = getProtect();
           prec.setProtect(sheet);
           PasswordRecord pass = getPassword();
           pass.setPassword((short)00);
        }
        if(objprotect != null && !objects) {
            objprotect.setProtect(false);
        }
        if(scenprotect != null && !scenarios) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.