/** * Find the "Current User" stream, and load it */ private void readCurrentUserStream() { try { currentUser = new CurrentUserAtom(directory); } catch(IOException ie) { logger.log(POILogger.ERROR, "Error finding Current User Atom:\n" + ie); currentUser = new CurrentUserAtom(); } }
_records = read(_docstream, (int) currentUser.getCurrentEditOffset());
/** * Create things from the bytes */ public CurrentUserAtom(byte[] b) { _contents = b; init(); }
int oldLastUserEditAtomPos = (int)currentUser.getCurrentEditOffset(); Integer newLastUserEditAtomPos = (Integer)oldToNewPositions.get(Integer.valueOf(oldLastUserEditAtomPos)); if(newLastUserEditAtomPos == null) { throw new HSLFException("Couldn't find the new location of the UserEditAtom that used to be at " + oldLastUserEditAtomPos); currentUser.setCurrentEditOffset(newLastUserEditAtomPos.intValue()); currentUser.writeToFS(outFS); writtenEntries.add("Current User");
int oldLastUserEditAtomPos = (int) currentUser.getCurrentEditOffset(); Integer newLastUserEditAtomPos = oldToNewPositions.get(oldLastUserEditAtomPos); if (newLastUserEditAtomPos == null || usr.getLastOnDiskOffset() != newLastUserEditAtomPos) { throw new HSLFException("Couldn't find the new location of the last UserEditAtom that used to be at " + oldLastUserEditAtomPos); currentUser.setCurrentEditOffset(usr.getLastOnDiskOffset());
writtenEntries.add(POWERPOINT_DOCUMENT); currentUser.setEncrypted(encryptedSS.getDocumentEncryptionAtom() != null); currentUser.writeToFS(outFS); writtenEntries.add("Current User");
/** * Writes ourselves back out to a filesystem */ public void writeToFS(POIFSFileSystem fs) throws IOException { // Grab contents ByteArrayOutputStream baos = new ByteArrayOutputStream(); writeOut(baos); ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray()); // Write out fs.createOrUpdateDocument(bais,"Current User"); } }
HSLFSlideShowImpl slideShow2 = new HSLFSlideShowImpl(new FileInputStream(newFile)); String lastEditUsername1 = slideShow1.getCurrentUserAtom().getLastEditUsername(); String lastEditUsername2 = slideShow2.getCurrentUserAtom().getLastEditUsername();
/** * Writes ourselves back out to a filesystem */ public void writeToFS(POIFSFileSystem fs) throws IOException { // Grab contents ByteArrayOutputStream baos = new ByteArrayOutputStream(); writeOut(baos); ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray()); // Write out fs.createDocument(bais,"Current User"); } }
HSLFSlideShowImpl slideShow2 = new HSLFSlideShowImpl(new FileInputStream(newFile)); String lastEditUsername1 = slideShow1.getCurrentUserAtom().getLastEditUsername(); String lastEditUsername2 = slideShow2.getCurrentUserAtom().getLastEditUsername();
_records = read(_docstream, (int)currentUser.getCurrentEditOffset());
/** * Find the "Current User" stream, and load it */ private void readCurrentUserStream() { try { currentUser = new CurrentUserAtom(getDirectory()); } catch (IOException ie) { logger.log(POILogger.ERROR, "Error finding Current User Atom:\n" + ie); currentUser = new CurrentUserAtom(); } }
System.out.println(" Thinks the CurrentEditOffset is " + cua.getCurrentEditOffset());
System.out.println(" Thinks the CurrentEditOffset is " + cua.getCurrentEditOffset());
if(cua.getCurrentEditOffset() != 0) { if(cua.getCurrentEditOffset() > hss.getUnderlyingBytes().length) { throw new CorruptPowerPointFileException("The CurrentUserAtom claims that the offset of last edit details are past the end of the file"); r = Record.buildRecordAtOffset( hss.getUnderlyingBytes(), (int)cua.getCurrentEditOffset() ); } catch (ArrayIndexOutOfBoundsException e) {