/* package */ static boolean matchesSummary(ClassID actual, ClassID... expected) { for (ClassID sum : expected) { if (sum.equals(actual) || sum.equalsInverted(actual)) { return true; } } return false; }
@Override public boolean canExtract(DirectoryNode dn) { ClassID clsId = dn.getStorageClsid(); return (PdfClassID.equals(clsId) || dn.hasEntry("CONTENTS")); }
/** * Returns the PID string associated with a property ID. The ID * is first looked up in the {@link Section Sections} private dictionary. * If it is not found there, the property PID string is taken * from sections format IDs namespace. * If the PID is also undefined there, i.e. it is not well-known, * {@code "[undefined]"} is returned. * * @param pid The property ID * * @return The well-known property ID string associated with the * property ID {@code pid} */ public String getPIDString(final long pid) { Map<Long,String> dic = getDictionary(); if (dic == null || !dic.containsKey(pid)) { ClassID fmt = getFormatID(); if (SummaryInformation.FORMAT_ID.equals(fmt)) { dic = PropertyIDMap.getSummaryInformationProperties(); } else if (DocumentSummaryInformation.FORMAT_ID[0].equals(fmt)) { dic = PropertyIDMap.getDocumentSummaryInformationProperties(); } } return (dic != null && dic.containsKey(pid)) ? dic.get(pid) : PropertyIDMap.UNDEFINED; }
/* package */ static boolean matchesSummary(ClassID actual, ClassID... expected) { for (ClassID sum : expected) { if (sum.equals(actual) || sum.equalsInverted(actual)) { return true; } } return false; }
if (!s.getFormatID().equals(getFormatID())) { return false;
int sectionCount2 = getSectionCount(); if (byteOrder1 != byteOrder2 || !classID1.equals(classID2) || format1 != format2 || osVersion1 != osVersion2 ||
@Override public boolean canExtract(DirectoryNode dn) { ClassID clsId = dn.getStorageClsid(); return (PdfClassID.equals(clsId) || dn.hasEntry("CONTENTS")); }
/** * Returns the PID string associated with a property ID. The ID * is first looked up in the {@link Section Sections} private dictionary. * If it is not found there, the property PID string is taken * from sections format IDs namespace. * If the PID is also undefined there, i.e. it is not well-known, * {@code "[undefined]"} is returned. * * @param pid The property ID * * @return The well-known property ID string associated with the * property ID {@code pid} */ public String getPIDString(final long pid) { Map<Long,String> dic = getDictionary(); if (dic == null || !dic.containsKey(pid)) { ClassID fmt = getFormatID(); if (SummaryInformation.FORMAT_ID.equals(fmt)) { dic = PropertyIDMap.getSummaryInformationProperties(); } else if (DocumentSummaryInformation.FORMAT_ID[0].equals(fmt)) { dic = PropertyIDMap.getDocumentSummaryInformationProperties(); } } return (dic != null && dic.containsKey(pid)) ? dic.get(pid) : PropertyIDMap.UNDEFINED; }
if (!s.getFormatID().equals(getFormatID())) { return false;
@Override public void sanitize(InputStream inputStream, OutputStream outputStream, BleachSession session) throws BleachException { try (POIFSFileSystem fsIn = new POIFSFileSystem(inputStream); POIFSFileSystem fs = new POIFSFileSystem()) { // @TODO: Filter based on Storage Class ID - see issue #23 sanitize(session, fsIn, fs); if (ClassID.EXCEL97.equals(fs.getRoot().getStorageClsid())) { ExcelRecordCleaner.cleanupAndSaveExcel97(fs, outputStream); } else { fs.writeFilesystem(outputStream); } } catch (IOException | IndexOutOfBoundsException e) { throw new BleachException(e); } }
if (new ClassID().equals(root.getStorageClsid())) {
return false; final Section s = (Section) o; if (!s.getFormatID().equals(getFormatID())) return false;
int sectionCount2 = getSectionCount(); if (byteOrder1 != byteOrder2 || !classID1.equals(classID2) || format1 != format2 || osVersion1 != osVersion2 ||
return false; final Section s = (Section) o; if (!s.getFormatID().equals(getFormatID())) return false;
int sectionCount2 = getSectionCount(); if (byteOrder1 != byteOrder2 || !classID1.equals(classID2) || format1 != format2 || osVersion1 != osVersion2 ||
int sectionCount2 = getSectionCount(); if (byteOrder1 != byteOrder2 || !classID1.equals(classID2) || format1 != format2 || osVersion1 != osVersion2 ||