/** * Returns a string for display. * * @return the string. */ public String toString() { return "SavedByEntry[userName=" + getUserName() + ",saveLocation=" + getSaveLocation() + "]"; } }
private void extractSavedByMetadata(HWPFDocument document) { SavedByTable savedByTable = document.getSavedByTable(); if (savedByTable == null) { return; } for (SavedByEntry sbe : savedByTable.getEntries()) { metadata.add(TikaCoreProperties.ORIGINAL_RESOURCE_NAME, sbe.getSaveLocation()); } }
/** * Constructor to read the table from the table stream. * * @param tableStream * the table stream. * @param offset * the offset into the byte array. * @param size * the size of the table in the byte array. */ public SavedByTable( byte[] tableStream, int offset, int size ) { String[] strings = SttbUtils.readSttbSavedBy( tableStream, offset ); int numEntries = strings.length / 2; entries = new SavedByEntry[numEntries]; for ( int i = 0; i < numEntries; i++ ) { entries[i] = new SavedByEntry( strings[i * 2], strings[i * 2 + 1] ); } }
private void extractSavedByMetadata(HWPFDocument document) { SavedByTable savedByTable = document.getSavedByTable(); if (savedByTable == null) { return; } for (SavedByEntry sbe : savedByTable.getEntries()) { metadata.add(TikaCoreProperties.ORIGINAL_RESOURCE_NAME, sbe.getSaveLocation()); } }
/** * Constructor to read the table from the table stream. * * @param tableStream * the table stream. * @param offset * the offset into the byte array. * @param size * the size of the table in the byte array. */ public SavedByTable( byte[] tableStream, int offset, int size ) { String[] strings = SttbUtils.readSttbSavedBy( tableStream, offset ); int numEntries = strings.length / 2; entries = new SavedByEntry[numEntries]; for ( int i = 0; i < numEntries; i++ ) { entries[i] = new SavedByEntry( strings[i * 2], strings[i * 2 + 1] ); } }
/** * Returns a string for display. * * @return the string. */ public String toString() { return "SavedByEntry[userName=" + getUserName() + ",saveLocation=" + getSaveLocation() + "]"; } }
private void extractSavedByMetadata(HWPFDocument document) { SavedByTable savedByTable = document.getSavedByTable(); if (savedByTable == null) { return; } for (SavedByEntry sbe : savedByTable.getEntries()) { metadata.add(TikaCoreProperties.ORIGINAL_RESOURCE_NAME, sbe.getSaveLocation()); } }
/** * Writes this table to the table stream. * * @param tableStream * the table stream to write to. * @throws IOException * if an error occurs while writing. */ public void writeTo( HWPFOutputStream tableStream ) throws IOException { String[] toSave = new String[entries.length * 2]; int counter = 0; for ( SavedByEntry entry : entries ) { toSave[counter++] = entry.getUserName(); toSave[counter++] = entry.getSaveLocation(); } SttbUtils.writeSttbSavedBy( toSave, tableStream ); }
/** * Writes this table to the table stream. * * @param tableStream * the table stream to write to. * @throws IOException * if an error occurs while writing. */ public void writeTo( ByteArrayOutputStream tableStream ) throws IOException { String[] toSave = new String[entries.length * 2]; int counter = 0; for ( SavedByEntry entry : entries ) { toSave[counter++] = entry.getUserName(); toSave[counter++] = entry.getSaveLocation(); } SttbUtils.writeSttbSavedBy( toSave, tableStream ); }