本文整理汇总了Java中org.apache.poi.openxml4j.opc.internal.PackagePropertiesPart类的典型用法代码示例。如果您正苦于以下问题:Java PackagePropertiesPart类的具体用法?Java PackagePropertiesPart怎么用?Java PackagePropertiesPart使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
PackagePropertiesPart类属于org.apache.poi.openxml4j.opc.internal包,在下文中一共展示了PackagePropertiesPart类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getData
import org.apache.poi.openxml4j.opc.internal.PackagePropertiesPart; //导入依赖的package包/类
private ByteArrayEditableData getData() throws IOException, TreeModelLoadException {
if (packagePart instanceof PackagePropertiesPart) {
return new ByteArrayEditableData("Property parts can't be exported.".getBytes(LocaleUtil.CHARSET_1252));
}
FileMagic fm;
try (InputStream is = FileMagic.prepareToCheckMagic(packagePart.getInputStream())) {
final ByteArrayEditableData data = new ByteArrayEditableData();
fm = FileMagic.valueOf(is);
if (fm == FileMagic.OLE2) {
if (oleFile == null) {
oleFile = copyToTempFile(is);
OLETreeModel poifsNode = appContext.getBean(OLETreeModel.class, treeNode);
poifsNode.load(oleFile);
((TreeModelEntry)treeNode.getUserObject()).activate();
}
try (InputStream is2 = new FileInputStream(oleFile)) {
data.loadFromStream(is2);
}
} else {
data.loadFromStream(is);
}
return data;
}
}
示例2: info
import org.apache.poi.openxml4j.opc.internal.PackagePropertiesPart; //导入依赖的package包/类
private void info(Struct sct, PackagePropertiesPart props) {
if(props==null) return;
set(sct, "AUTHOR", props.getCreatorProperty().getValue());
set(sct, "CATEGORY", props.getCategoryProperty().getValue());
set(sct, "COMMENTS", props.getDescriptionProperty().getValue());
set(sct, "CREATIONDATE", props.getCreatedProperty().getValue());
set(sct, "KEYWORDS", props.getKeywordsProperty().getValue());
set(sct, "LASTAUTHOR", props.getLastModifiedByProperty().getValue());
set(sct, "LASTEDITED", props.getModifiedProperty().getValue());
set(sct, "SUBJECT", props.getSubjectProperty().getValue());
set(sct, "TITLE", props.getTitleProperty().getValue());
}
示例3: extractMetadata
import org.apache.poi.openxml4j.opc.internal.PackagePropertiesPart; //导入依赖的package包/类
private void extractMetadata(CoreProperties properties, Metadata metadata) {
PackagePropertiesPart propsHolder = properties
.getUnderlyingProperties();
addProperty(metadata, OfficeOpenXMLCore.CATEGORY, propsHolder.getCategoryProperty());
addProperty(metadata, OfficeOpenXMLCore.CONTENT_STATUS, propsHolder
.getContentStatusProperty());
addProperty(metadata, TikaCoreProperties.CREATED, propsHolder
.getCreatedProperty());
addProperty(metadata, TikaCoreProperties.CREATOR, propsHolder
.getCreatorProperty());
addProperty(metadata, TikaCoreProperties.DESCRIPTION, propsHolder
.getDescriptionProperty());
addProperty(metadata, TikaCoreProperties.IDENTIFIER, propsHolder
.getIdentifierProperty());
addProperty(metadata, TikaCoreProperties.KEYWORDS, propsHolder
.getKeywordsProperty());
addProperty(metadata, TikaCoreProperties.LANGUAGE, propsHolder
.getLanguageProperty());
addProperty(metadata, TikaCoreProperties.MODIFIER, propsHolder
.getLastModifiedByProperty());
addProperty(metadata, TikaCoreProperties.PRINT_DATE, propsHolder
.getLastPrintedProperty());
addProperty(metadata, Metadata.LAST_MODIFIED, propsHolder
.getModifiedProperty());
addProperty(metadata, TikaCoreProperties.MODIFIED, propsHolder
.getModifiedProperty());
addProperty(metadata, OfficeOpenXMLCore.REVISION, propsHolder
.getRevisionProperty());
// TODO: Move to OO subject in Tika 2.0
addProperty(metadata, TikaCoreProperties.TRANSITION_SUBJECT_TO_OO_SUBJECT,
propsHolder.getSubjectProperty());
addProperty(metadata, TikaCoreProperties.TITLE, propsHolder.getTitleProperty());
addProperty(metadata, OfficeOpenXMLCore.VERSION, propsHolder.getVersionProperty());
// Legacy Tika-1.0 style stats
// TODO Remove these in Tika 2.0
addProperty(metadata, Metadata.CATEGORY, propsHolder.getCategoryProperty());
addProperty(metadata, Metadata.CONTENT_STATUS, propsHolder
.getContentStatusProperty());
addProperty(metadata, Metadata.REVISION_NUMBER, propsHolder
.getRevisionProperty());
addProperty(metadata, Metadata.VERSION, propsHolder.getVersionProperty());
}