本文整理了Java中org.apache.poi.hssf.usermodel.HSSFWorkbook.getDirectory()
方法的一些代码示例,展示了HSSFWorkbook.getDirectory()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。HSSFWorkbook.getDirectory()
方法的具体详情如下:
包路径:org.apache.poi.hssf.usermodel.HSSFWorkbook
类名称:HSSFWorkbook
方法名:getDirectory
暂无
代码示例来源:origin: org.apache.poi/poi
/**
* create shape tree from existing escher records tree
*/
void buildShapeTree() {
EscherContainerRecord dgContainer = _boundAggregate.getEscherContainer();
if (dgContainer == null) {
return;
}
EscherContainerRecord spgrConrainer = dgContainer.getChildContainers().get(0);
List<EscherContainerRecord> spgrChildren = spgrConrainer.getChildContainers();
for (int i = 0; i < spgrChildren.size(); i++) {
EscherContainerRecord spContainer = spgrChildren.get(i);
if (i != 0) {
HSSFShapeFactory.createShapeTree(spContainer, _boundAggregate, this, _sheet.getWorkbook().getDirectory());
}
}
}
代码示例来源:origin: org.apache.poi/poi
new FilteringDirectoryNode(getDirectory(), excepts)
, new FilteringDirectoryNode(fs.getRoot(), excepts)
);
fs.getRoot().setStorageClsid(getDirectory().getStorageClsid());
代码示例来源:origin: org.apache.poi/poi
@Override
public int addOlePackage(byte[] oleData, String label, String fileName, String command)
throws IOException {
// check if we were created by POIFS otherwise create a new dummy POIFS for storing the package data
if (initDirectory()) {
preserveNodes = true;
}
// get free MBD-Node
int storageId = 0;
DirectoryEntry oleDir = null;
do {
String storageStr = "MBD"+ HexDump.toHex(++storageId);
if (!getDirectory().hasEntry(storageStr)) {
oleDir = getDirectory().createDirectory(storageStr);
oleDir.setStorageClsid(ClassIDPredefined.OLE_V1_PACKAGE.getClassID());
}
} while (oleDir == null);
Ole10Native.createOleMarkerEntry(oleDir);
Ole10Native oleNative = new Ole10Native(label, fileName, command, oleData);
ByteArrayOutputStream bos = new ByteArrayOutputStream();
oleNative.writeOut(bos);
oleDir.createDocument(Ole10Native.OLE10_NATIVE, new ByteArrayInputStream(bos.toByteArray()));
return storageId;
}
代码示例来源:origin: org.apache.poi/poi
/**
* Write out this workbook to the currently open {@link File} via the
* writeable {@link POIFSFileSystem} it was opened as.
*
* <p>This will fail (with an {@link IllegalStateException} if the
* Workbook was opened read-only, opened from an {@link InputStream}
* instead of a File, or if this is not the root document. For those cases,
* you must use {@link #write(OutputStream)} or {@link #write(File)} to
* write to a brand new document.
*/
@Override
public void write() throws IOException {
validateInPlaceWritePossible();
final DirectoryNode dir = getDirectory();
// Update the Workbook stream in the file
DocumentNode workbookNode = (DocumentNode)dir.getEntry(
getWorkbookDirEntryName(dir));
POIFSDocument workbookDoc = new POIFSDocument(workbookNode);
workbookDoc.replaceContents(new ByteArrayInputStream(getBytes()));
// Update the properties streams in the file
writeProperties();
// Sync with the File on disk
dir.getFileSystem().writeFilesystem();
}
代码示例来源:origin: org.apache.poi/poi
DirectoryEntry oleRoot;
try {
DirectoryNode dn = _sheet.getWorkbook().getDirectory();
if (dn == null) {
throw new FileNotFoundException();
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.poi
/**
* create shape tree from existing escher records tree
*/
void buildShapeTree() {
EscherContainerRecord dgContainer = _boundAggregate.getEscherContainer();
if (dgContainer == null) {
return;
}
EscherContainerRecord spgrConrainer = dgContainer.getChildContainers().get(0);
List<EscherContainerRecord> spgrChildren = spgrConrainer.getChildContainers();
for (int i = 0; i < spgrChildren.size(); i++) {
EscherContainerRecord spContainer = spgrChildren.get(i);
if (i != 0) {
HSSFShapeFactory.createShapeTree(spContainer, _boundAggregate, this, _sheet.getWorkbook().getDirectory());
}
}
}
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.poi
new FilteringDirectoryNode(getDirectory(), excepts)
, new FilteringDirectoryNode(fs.getRoot(), excepts)
);
fs.getRoot().setStorageClsid(getDirectory().getStorageClsid());
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.poi
@Override
public int addOlePackage(byte[] oleData, String label, String fileName, String command)
throws IOException {
// check if we were created by POIFS otherwise create a new dummy POIFS for storing the package data
if (initDirectory()) {
preserveNodes = true;
}
// get free MBD-Node
int storageId = 0;
DirectoryEntry oleDir = null;
do {
String storageStr = "MBD"+ HexDump.toHex(++storageId);
if (!getDirectory().hasEntry(storageStr)) {
oleDir = getDirectory().createDirectory(storageStr);
oleDir.setStorageClsid(ClassIDPredefined.OLE_V1_PACKAGE.getClassID());
}
} while (oleDir == null);
Ole10Native.createOleMarkerEntry(oleDir);
Ole10Native oleNative = new Ole10Native(label, fileName, command, oleData);
ByteArrayOutputStream bos = new ByteArrayOutputStream();
oleNative.writeOut(bos);
oleDir.createDocument(Ole10Native.OLE10_NATIVE, new ByteArrayInputStream(bos.toByteArray()));
return storageId;
}
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.poi
/**
* Write out this workbook to the currently open {@link File} via the
* writeable {@link POIFSFileSystem} it was opened as.
*
* <p>This will fail (with an {@link IllegalStateException} if the
* Workbook was opened read-only, opened from an {@link InputStream}
* instead of a File, or if this is not the root document. For those cases,
* you must use {@link #write(OutputStream)} or {@link #write(File)} to
* write to a brand new document.
*/
@Override
public void write() throws IOException {
validateInPlaceWritePossible();
final DirectoryNode dir = getDirectory();
// Update the Workbook stream in the file
DocumentNode workbookNode = (DocumentNode)dir.getEntry(
getWorkbookDirEntryName(dir));
POIFSDocument workbookDoc = new POIFSDocument(workbookNode);
workbookDoc.replaceContents(new ByteArrayInputStream(getBytes()));
// Update the properties streams in the file
writeProperties();
// Sync with the File on disk
dir.getFileSystem().writeFilesystem();
}
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.poi
DirectoryEntry oleRoot;
try {
DirectoryNode dn = _sheet.getWorkbook().getDirectory();
if (dn == null) {
throw new FileNotFoundException();
内容来源于网络,如有侵权,请联系作者删除!