Modified: poi/site/publish/components/poifs/embeded.html URL: http://svn.apache.org/viewvc/poi/site/publish/components/poifs/embeded.html?rev=1836244&r1=1836243&r2=1836244&view=diff ============================================================================== --- poi/site/publish/components/poifs/embeded.html (original) +++ poi/site/publish/components/poifs/embeded.html Wed Jul 18 23:27:21 2018 @@ -1,154 +1,297 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <META http-equiv="Content-Type" content="text/html; charset=UTF-8"> -<!--*** This is a generated file. Do not edit. ***--> -<link rel="stylesheet" href="../skin/tigris.css" type="text/css"> -<link rel="stylesheet" href="../skin/mysite.css" type="text/css"> -<link rel="stylesheet" href="../skin/site.css" type="text/css"> -<link media="print" rel="stylesheet" href="../skin/print.css" type="text/css"> +<meta content="Apache Forrest" name="Generator"> +<meta name="Forrest-version" content="0.9"> +<meta name="Forrest-skin-name" content="pelt"> <title>Apache POI - POIFS - Documents embedded in other documents</title> +<link type="text/css" href="../../skin/basic.css" rel="stylesheet"> +<link media="screen" type="text/css" href="../../skin/screen.css" rel="stylesheet"> +<link media="print" type="text/css" href="../../skin/print.css" rel="stylesheet"> +<link type="text/css" href="../../skin/profile.css" rel="stylesheet"> +<script src="../../skin/getBlank.js" language="javascript" type="text/javascript"></script><script src="../../skin/getMenu.js" language="javascript" type="text/javascript"></script><script src="../../skin/fontsize.js" language="javascript" type="text/javascript"></script> +<link rel="shortcut icon" href="../../images/favicon.ico"> </head> -<body bgcolor="white" class="composite"> -<!--================= start Banner ==================--> -<div id="banner"> -<table width="100%" cellpadding="8" cellspacing="0" summary="banner" border="0"> -<tbody> -<tr> -<!--================= start Group Logo ==================--> -<td width="50%" align="left"> -<div class="groupLogo"> -<a href="https://www.apache.org"><img border="0" class="logoImage" alt="The Apache Software Foundation" src="../resources/images/asf_logo.png"></a> -</div> -</td> -<!--================= end Group Logo ==================--> -<!--================= start Project Logo ==================--><td width="50%" align="right"> -<div align="right" class="projectLogo"> -<a href="https://donate.apache.org/"><img border="0" class="logoImage" alt="Support Apache" src="../resources/images/support-asf.png" width="120" height="120" title="Your donation helps The Apache Software Foundation ensure its community-driven software remains available to billions of users at absolutely no cost."></a><a href="https://poi.apache.org/"><img border="0" class="logoImage" alt="Apache POI" src="../resources/images/pb-poi.png" width="120" height="120" title="Apache POI - the Java API for Microsoft Documents"></a> -</div> -</td> -<!--================= end Project Logo ==================--> -</tr> -</tbody> -</table> -</div> -<!--================= end Banner ==================--> -<!--================= start Main ==================--> -<table width="100%" cellpadding="0" cellspacing="0" border="0" summary="nav" id="breadcrumbs"> -<tbody> -<!--================= start Status ==================--> -<tr class="status"> -<td> -<!--================= start BreadCrumb ==================--><a href="https://www.apache.org/">Apache</a> | <a href="https://poi.apache.org/">POI</a><a href=""></a> -<!--================= end BreadCrumb ==================--></td><td id="tabs"> -<!--================= start Tabs ==================--> -<div class="tab"> -<span class="selectedTab"><a class="base-selected" href="../index.html">Home</a></span> | <script language="Javascript" type="text/javascript"> -function printit() { -if (window.print) { - window.print() ; -} else { - var WebBrowser = '<OBJECT ID="WebBrowser1" WIDTH="0" HEIGHT="0" CLASSID="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></OBJECT>'; -document.body.insertAdjacentHTML('beforeEnd', WebBrowser); - WebBrowser1.ExecWB(6, 2);//Use a 1 vs. a 2 for a prompting dialog box WebBrowser1.outerHTML = ""; -} -} -</script><script language="Javascript" type="text/javascript"> -var NS = (navigator.appName == "Netscape"); -var VERSION = parseInt(navigator.appVersion); -if (VERSION > 3) { - document.write(' <a title="PRINT this page OUT" href="javascript:printit()">PRINT</a>'); -} -</script> -</div> -<!--================= end Tabs ==================--> -</td> -</tr> -</tbody> -</table> -<!--================= end Status ==================--> -<table id="main" width="100%" cellpadding="8" cellspacing="0" summary="" border="0"> -<tbody> -<tr valign="top"> -<!--================= start Menu ==================--> -<td id="leftcol"> -<div id="navcolumn"> -<div class="menuBar"> -<div class="menu"> -<span class="menuLabel">Apache POI</span> - -<div class="menuItem"> -<a href="../index.html">Top</a> +<body onload="init()"> +<script type="text/javascript">ndeSetTextSize();</script> +<div id="top"> +<!--+ + |breadtrail + +--> +<div class="breadtrail"> +<a href="https://www.apache.org">Apache Software Foundation</a> > <a href="https://poi.apache.org">Apache POI</a><script src="../../skin/breadcrumbs.js" language="JavaScript" type="text/javascript"></script> +</div> +<!--+ + |header + +--> +<div class="header"> +<!--+ + |start group logo + +--> +<div class="grouplogo"> +<a href="https://www.apache.org"><img class="logoImage" alt="Apache Software Foundation" src="../../images/group-logo.png" title="The Apache Software Foundation is a cornerstone of the modern Open Source software ecosystem – supporting some of the most widely used and important software solutions powering today's Internet economy."></a> +</div> +<!--+ + |end group logo + +--> +<!--+ + |start Project Logo + +--> +<div class="projectlogo"> +<a href="https://poi.apache.org"><img class="logoImage" alt="Apache POI" src="../../images/project-logo.png" title="Apache POI is well-known in the Java field as a library for reading and writing Microsoft Office file formats, such as Excel, PowerPoint, Word, Visio, Publisher and Outlook. It supports both the older (OLE2) and new (OOXML - Office Open XML) formats."></a> +</div> +<!--+ + |end Project Logo + +--> +<!--+ + |start Search + +--> +<div class="searchbox"> +<form action="http://www.google.com/search" method="get" class="roundtopsmall"> +<input value="poi.apache.org" name="sitesearch" type="hidden"><input onFocus="getBlank (this, 'Search the site with google');" size="25" name="q" id="query" type="text" value="Search the site with google"> + <input name="Search" value="Search" type="submit"> +</form> </div> - +<!--+ + |end search + +--> +<!--+ + |start Tabs + +--> +<ul id="tabs"> +<li> +<a class="unselected" href="../../index.html">Home</a> +</li> +<li> +<a class="unselected" href="../../help/index.html">Help</a> +</li> +<li class="current"> +<a class="selected" href="../../components/index.html">Component APIs</a> +</li> +<li> +<a class="unselected" href="../../devel/index.html">Getting Involved</a> +</li> +</ul> +<!--+ + |end Tabs + +--> +</div> +</div> +<div id="main"> +<div id="publishedStrip"> +<!--+ + |start Subtabs + +--> +<div id="level2tabs"></div> +<!--+ + |end Endtabs + +--> +<script type="text/javascript"><!-- +document.write("Last Published: " + document.lastModified); +// --></script> +</div> +<!--+ + |breadtrail + +--> +<div class="breadtrail"> + + + </div> +<!--+ + |start Menu, mainarea + +--> +<!--+ + |start Menu + +--> +<div id="menu"> +<div onclick="SwitchMenu('menu_selected_1.1', '../../skin/')" id="menu_selected_1.1Title" class="menutitle" style="background-image: url('../../skin/images/chapter_open.gif');">Component APIs</div> +<div id="menu_selected_1.1" class="selectedmenuitemgroup" style="display: block;"> +<div class="menuitem"> +<a href="../../components/index.html">Overview</a> </div> -<div class="menu"> -<span class="menuLabel">POIFS</span> - -<div class="menuItem"> -<a href="index.html">Overview</a> +<div class="menuitem"> +<a href="../../apidocs/index.html">Javadocs</a> </div> - -<div class="menuItem"> -<a href="how-to.html">How To</a> +<div onclick="SwitchMenu('menu_1.1.3', '../../skin/')" id="menu_1.1.3Title" class="menutitle">Excel (HSSF/XSSF)</div> +<div id="menu_1.1.3" class="menuitemgroup"> +<div class="menuitem"> +<a href="../../components/spreadsheet/index.html">Overview</a> </div> - -<div class="menuItem"> -<span class="menuSelected">Embedded Documents</span> +<div class="menuitem"> +<a href="../../components/spreadsheet/quick-guide.html">Quick Guide</a> </div> - -<div class="menuItem"> -<a href="fileformat.html">File System Documentation</a> +<div class="menuitem"> +<a href="../../components/spreadsheet/how-to.html">HOWTO</a> </div> - -<div class="menuItem"> -<a href="usecases.html">Use Cases</a> +<div class="menuitem"> +<a href="../../components/spreadsheet/converting.html">HSSF to SS Converting</a> </div> - +<div class="menuitem"> +<a href="../../components/spreadsheet/formula.html">Formula Support</a> </div> -<center> -<a href="https://www.apache.org/events/current-event.html"><img src="https://www.apache.org/events/current-event-125x125.png"></a> -</center> -</div> -</div> -<form target="_blank" action="https://www.google.com/search" method="get"> -<table summary="search" border="0" cellspacing="0" cellpadding="0"> -<tr> -<td><img height="1" width="1" alt="" src="../skin/images/spacer.gif" class="spacer"></td><td nowrap="nowrap"> - Search Apache POI<br> -<input value="poi.apache.org" name="sitesearch" type="hidden"><input size="10" name="q" id="query" type="text"><img height="1" width="5" alt="" src="../skin/images/spacer.gif" class="spacer"><input name="Search" value="GO" type="submit"></td><td><img height="1" width="1" alt="" src="../skin/images/spacer.gif" class="spacer"></td> -</tr> -<tr> -<td colspan="3"><img height="7" width="1" alt="" src="../skin/images/spacer.gif" class="spacer"></td> -</tr> -<tr> -<td class="bottom-left-thick"></td><td bgcolor="#a5b6c6"><img height="1" width="1" alt="" src="../skin/images/spacer.gif" class="spacer"></td><td class="bottom-right-thick"></td> -</tr> -</table> -</form> -</td> -<!--================= end Menu ==================--> -<!--================= start Content ==================--><td> -<div id="bodycol"> -<div class="app"> -<div align="center"> -<h1>Apache POI - POIFS - Documents embedded in other documents</h1> +<div class="menuitem"> +<a href="../../components/spreadsheet/eval.html">Formula Evaluation</a> </div> -<div class="h3"> - - +<div class="menuitem"> +<a href="../../components/spreadsheet/eval-devguide.html">Eval Dev Guide</a> +</div> +<div class="menuitem"> +<a href="../../components/spreadsheet/examples.html">Examples</a> +</div> +<div class="menuitem"> +<a href="../../components/spreadsheet/use-case.html">Use Case</a> +</div> +<div class="menuitem"> +<a href="../../components/spreadsheet/diagrams.html">Pictorial Docs</a> +</div> +<div class="menuitem"> +<a href="../../components/spreadsheet/limitations.html">Limitations</a> +</div> +<div class="menuitem"> +<a href="../../components/spreadsheet/user-defined-functions.html">User Defined Functions</a> +</div> +<div class="menuitem"> +<a href="../../components/spreadsheet/excelant.html">ExcelAnt Tests</a> +</div> +<div class="menuitem"> +<a href="../../components/spreadsheet/hacking-hssf.html">Hacking HSSF</a> +</div> +<div class="menuitem"> +<a href="../../components/spreadsheet/record-generator.html">Record Generator</a> +</div> +<div class="menuitem"> +<a href="../../components/spreadsheet/chart.html">Charts</a> +</div> +</div> +<div onclick="SwitchMenu('menu_1.1.4', '../../skin/')" id="menu_1.1.4Title" class="menutitle">PowerPoint (HSLF/XSLF)</div> +<div id="menu_1.1.4" class="menuitemgroup"> +<div class="menuitem"> +<a href="../../components/slideshow/index.html">Overview</a> +</div> +<div class="menuitem"> +<a href="../../components/slideshow/quick-guide.html">Quick Guide</a> +</div> +<div class="menuitem"> +<a href="../../components/slideshow/how-to-shapes.html">HSLF Cookbook</a> +</div> +<div class="menuitem"> +<a href="../../components/slideshow/xslf-cookbook.html">XSLF Cookbook</a> +</div> +<div class="menuitem"> +<a href="../../components/slideshow/ppt-file-format.html">PPT File Format</a> +</div> +</div> +<div onclick="SwitchMenu('menu_1.1.5', '../../skin/')" id="menu_1.1.5Title" class="menutitle">Word (HWPF/XWPF)</div> +<div id="menu_1.1.5" class="menuitemgroup"> +<div class="menuitem"> +<a href="../../components/document/index.html">Overview</a> +</div> +<div class="menuitem"> +<a href="../../components/document/quick-guide.html">HWPF Quick Guide</a> +</div> +<div class="menuitem"> +<a href="../../components/document/quick-guide-xwpf.html">XWPF Quick Guide</a> +</div> +<div class="menuitem"> +<a href="../../components/document/docoverview.html">HWPF Format</a> +</div> +<div class="menuitem"> +<a href="../../components/document/projectplan.html">HWPF Project plan</a> +</div> +</div> +<div class="menuitem"> +<a href="../../components/hsmf/index.html">Outlook (HSMF)</a> +</div> +<div class="menuitem"> +<a href="../../components/diagram/index.html">Visio (HDGF+XDGF)</a> +</div> +<div onclick="SwitchMenu('menu_1.1.8', '../../skin/')" id="menu_1.1.8Title" class="menutitle">Publisher (HPBF)</div> +<div id="menu_1.1.8" class="menuitemgroup"> +<div class="menuitem"> +<a href="../../components/hpbf/index.html">Overview</a> +</div> +<div class="menuitem"> +<a href="../../components/hpbf/file-format.html">File Format</a> +</div> +</div> +<div onclick="SwitchMenu('menu_selected_1.1.9', '../../skin/')" id="menu_selected_1.1.9Title" class="menutitle" style="background-image: url('../../skin/images/chapter_open.gif');">OLE2 Filesystem (POIFS)</div> +<div id="menu_selected_1.1.9" class="selectedmenuitemgroup" style="display: block;"> +<div class="menuitem"> +<a href="../../components/poifs/index.html">Overview</a> +</div> +<div class="menuitem"> +<a href="../../components/poifs/how-to.html">How To</a> +</div> +<div class="menupage"> +<div class="menupagetitle">Embedded Documents</div> +</div> +<div class="menuitem"> +<a href="../../components/poifs/fileformat.html">File System Documentation</a> +</div> +<div class="menuitem"> +<a href="../../components/poifs/usecases.html">Use Cases</a> +</div> +<div class="menuitem"> +<a href="../../components/poifs/design.html">Design</a> +</div> +</div> +<div onclick="SwitchMenu('menu_1.1.10', '../../skin/')" id="menu_1.1.10Title" class="menutitle">OLE2 Document Props (HPSF)</div> +<div id="menu_1.1.10" class="menuitemgroup"> +<div class="menuitem"> +<a href="../../components/hpsf/index.html">Overview</a> +</div> +<div class="menuitem"> +<a href="../../components/hpsf/how-to.html">How To</a> +</div> +<div class="menuitem"> +<a href="../../components/hpsf/thumbnails.html">Thumbnails</a> +</div> +<div class="menuitem"> +<a href="../../components/hpsf/internals.html">Internals</a> +</div> +<div class="menuitem"> +<a href="../../components/hpsf/todo.html">To Do</a> +</div> +</div> +<div class="menuitem"> +<a href="../../components/hmef/index.html">TNEF (HMEF) for winmail.dat</a> +</div> +<div class="menuitem"> +<a href="../../components/oxml4j/index.html">OpenXML4J (OOXML)</a> +</div> +<div class="menuitem"> +<a href="../../components/logging.html">Logging framework</a> +</div> +</div> +<div id="credit"></div> +<div id="roundbottom"> +<img style="display: none" class="corner" height="15" width="15" alt="" src="../../skin/images/rc-b-l-15-1body-2menu-3menu.png"></div> +<!--+ + |alternative credits + +--> +<div id="credit2"> +<a href="https://donate.apache.org/"><img border="0" title="Support Apache" alt="Support Apache - logo" src="../../images/support-asf.png" style="width: 125px;height: 125px;"></a> +</div> +</div> +<!--+ + |end Menu + +--> +<!--+ + |start content + +--> +<div id="content"> +<h1>Apache POI - POIFS - Documents embedded in other documents</h1> +<h3>Overview</h3> +<div id="front-matter"></div> <a name="Overview"></a> -<div class="h3"> -<h3>Overview<a title="Permanent link" class="headerlink" href="#Overview">#</a> -</h3> -</div> - +<h2 class="boxed">Overview</h2> +<div class="section"> <p>It is possible for one OLE 2 based document to have other OLE 2 documents embedded in it. For example, an Excel file may have a Word document and a PowerPoint slideshow embedded as part of it.</p> - <p>Normally, these other documents are stored in subdirectories of the OLE 2 (POIFS) filesystem. The exact location of the embedded documents will vary depending on the type of the @@ -157,76 +300,47 @@ if (VERSION > 3) { in, you will either need to process the appropriate OLE 2 linking entry in the master document, or simple iterate over all the directories in the filesystem.</p> - <p>As a general rule, you will find the same OLE 2 entries in the subdirectories, as you would've found at the root of the filesystem were a document to not be embedded.</p> - - <a name="Files+embedded+in+Excel"></a> -<div class="h4"> -<h4>Files embedded in Excel<a title="Permanent link" class="headerlink" href="#Files+embedded+in+Excel">#</a> -</h4> -</div> - +<h3 class="boxed">Files embedded in Excel</h3> <p>Excel normally stores embedded files in subdirectories of the filesystem root. Typically these subdirectories are named starting with MBD, with 8 hex characters following.</p> - - - <a name="Files+embedded+in+Word"></a> -<div class="h4"> -<h4>Files embedded in Word<a title="Permanent link" class="headerlink" href="#Files+embedded+in+Word">#</a> -</h4> -</div> - +<h3 class="boxed">Files embedded in Word</h3> <p>Word normally stores embedded files in subdirectories of the ObjectPool directory, itself a subdirectory of the filesystem root. Typically these subdirectories and named starting with an underscore, followed by 10 numbers.</p> - - - <a name="Files+embedded+in+PowerPoint"></a> -<div class="h4"> -<h4>Files embedded in PowerPoint<a title="Permanent link" class="headerlink" href="#Files+embedded+in+PowerPoint">#</a> -</h4> -</div> - +<h3 class="boxed">Files embedded in PowerPoint</h3> <p>PowerPoint does not normally store embedded files in the OLE2 layer. Instead, they are held within records of the main PowerPoint file. <br>See the <a href="./../slideshow/how-to-shapes.html#OLE">HSLF Tutorial</a> for how to retrieve embedded OLE objects from a presentation</p> - - +</div> <a name="Listing+POIFS+contents"></a> -<div class="h3"> -<h3>Listing POIFS contents<a title="Permanent link" class="headerlink" href="#Listing+POIFS+contents">#</a> -</h3> -</div> - +<h2 class="boxed">Listing POIFS contents</h2> +<div class="section"> <p>POIFS provides a simple tool for listing the contents of OLE2 files. This can allow you to see what your POIFS file contents, and hence if it has any embedded documents in it, and where.</p> - <p>The tool to use is <em>org.apache.poi.poifs.dev.POIFSLister</em>. This tool may be run from the command line, and takes a filename as its parameter. It will print out all the directories and files contained within the POIFS file.</p> - +</div> <a name="Opening+embedded+files"></a> -<div class="h3"> -<h3>Opening embedded files<a title="Permanent link" class="headerlink" href="#Opening+embedded+files">#</a> -</h3> -</div> - +<h2 class="boxed">Opening embedded files</h2> +<div class="section"> <p>All of the POIDocument classes (HSSFWorkbook, HSLFSlideShow, HWPFDocument and HDGFDiagram) can either be opened from a POIFSFileSystem, or from a specific directory within a @@ -234,55 +348,41 @@ if (VERSION > 3) { appropriate DirectoryNode that represents the subdirectory of interest, and pass this + the overall POIFSFileSystem to the constructor.</p> - <p>I you want to extract the textual contents of the embedded file, then open the appropriate POIDocument, and then pass this to the extractor class, instead of simply passing the POIFSFilesystem to the extractor.</p> - - - -<div id="authors" align="right">by Nick Burch, Yegor Kozlov</div> -</div> </div> + +<p align="right"> +<font size="-2">by Nick Burch, Yegor Kozlov</font> +</p> +</div> +<!--+ + |end content + +--> +<div class="clearboth"> </div> </div> -</td> -<!--================= end Content ==================--> -</tr> -</tbody> -</table> -<!--================= end Main ==================--> -<!--================= start Footer ==================--> <div id="footer"> -<table summary="footer" cellspacing="0" cellpadding="4" width="100%" border="0"> -<tbody> -<tr> -<!--================= start Copyright ==================--> -<td colspan="2"> -<div align="center"> +<!--+ + |start bottomstrip + +--> +<div class="lastmodified"> +<script type="text/javascript"><!-- +document.write("Last Published: " + document.lastModified); +// --></script> +</div> <div class="copyright"> - Copyright © 2002-2018 The Apache Software Foundation. All rights reserved.<br> - Apache, Apache POI, and the Apache POI logo are registered trademarks or - trademarks of The Apache Software Foundation in the U.S. and/or other countries. - </div> -</div> -</td> -<!--================= end Copyright ==================--> -</tr> -<tr> -<td align="left"> -<!--================= start Host ==================--> -<!--================= end Host ==================--></td><td align="right"> -<!--================= start Credits ==================--> -<div align="right"> -<div class="credit"></div> -</div> -<!--================= end Credits ==================--> -</td> -</tr> -</tbody> -</table> + Copyright © + 2001-2018 <a href="https://www.apache.org/">The Apache Software Foundation</a> +</div> +<div id="feedback"> + Send feedback about the website to: + <a id="feedbackto" href="mailto:[email protected]?subject=Feedback%C2%A0components/poifs/embeded.html">[email protected]</a> +</div> +<!--+ + |end bottomstrip + +--> </div> -<!--================= end Footer ==================--> </body> </html>
Modified: poi/site/publish/components/poifs/fileformat.html URL: http://svn.apache.org/viewvc/poi/site/publish/components/poifs/fileformat.html?rev=1836244&r1=1836243&r2=1836244&view=diff ============================================================================== --- poi/site/publish/components/poifs/fileformat.html (original) +++ poi/site/publish/components/poifs/fileformat.html Wed Jul 18 23:27:21 2018 @@ -1,155 +1,294 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <META http-equiv="Content-Type" content="text/html; charset=UTF-8"> -<!--*** This is a generated file. Do not edit. ***--> -<link rel="stylesheet" href="../skin/tigris.css" type="text/css"> -<link rel="stylesheet" href="../skin/mysite.css" type="text/css"> -<link rel="stylesheet" href="../skin/site.css" type="text/css"> -<link media="print" rel="stylesheet" href="../skin/print.css" type="text/css"> +<meta content="Apache Forrest" name="Generator"> +<meta name="Forrest-version" content="0.9"> +<meta name="Forrest-skin-name" content="pelt"> <title>POIFS File System Internals</title> +<link type="text/css" href="../../skin/basic.css" rel="stylesheet"> +<link media="screen" type="text/css" href="../../skin/screen.css" rel="stylesheet"> +<link media="print" type="text/css" href="../../skin/print.css" rel="stylesheet"> +<link type="text/css" href="../../skin/profile.css" rel="stylesheet"> +<script src="../../skin/getBlank.js" language="javascript" type="text/javascript"></script><script src="../../skin/getMenu.js" language="javascript" type="text/javascript"></script><script src="../../skin/fontsize.js" language="javascript" type="text/javascript"></script> +<link rel="shortcut icon" href="../../images/favicon.ico"> </head> -<body bgcolor="white" class="composite"> -<!--================= start Banner ==================--> -<div id="banner"> -<table width="100%" cellpadding="8" cellspacing="0" summary="banner" border="0"> -<tbody> -<tr> -<!--================= start Group Logo ==================--> -<td width="50%" align="left"> -<div class="groupLogo"> -<a href="https://www.apache.org"><img border="0" class="logoImage" alt="The Apache Software Foundation" src="../resources/images/asf_logo.png"></a> -</div> -</td> -<!--================= end Group Logo ==================--> -<!--================= start Project Logo ==================--><td width="50%" align="right"> -<div align="right" class="projectLogo"> -<a href="https://donate.apache.org/"><img border="0" class="logoImage" alt="Support Apache" src="../resources/images/support-asf.png" width="120" height="120" title="Your donation helps The Apache Software Foundation ensure its community-driven software remains available to billions of users at absolutely no cost."></a><a href="https://poi.apache.org/"><img border="0" class="logoImage" alt="Apache POI" src="../resources/images/pb-poi.png" width="120" height="120" title="Apache POI - the Java API for Microsoft Documents"></a> +<body onload="init()"> +<script type="text/javascript">ndeSetTextSize();</script> +<div id="top"> +<!--+ + |breadtrail + +--> +<div class="breadtrail"> +<a href="https://www.apache.org">Apache Software Foundation</a> > <a href="https://poi.apache.org">Apache POI</a><script src="../../skin/breadcrumbs.js" language="JavaScript" type="text/javascript"></script> +</div> +<!--+ + |header + +--> +<div class="header"> +<!--+ + |start group logo + +--> +<div class="grouplogo"> +<a href="https://www.apache.org"><img class="logoImage" alt="Apache Software Foundation" src="../../images/group-logo.png" title="The Apache Software Foundation is a cornerstone of the modern Open Source software ecosystem – supporting some of the most widely used and important software solutions powering today's Internet economy."></a> +</div> +<!--+ + |end group logo + +--> +<!--+ + |start Project Logo + +--> +<div class="projectlogo"> +<a href="https://poi.apache.org"><img class="logoImage" alt="Apache POI" src="../../images/project-logo.png" title="Apache POI is well-known in the Java field as a library for reading and writing Microsoft Office file formats, such as Excel, PowerPoint, Word, Visio, Publisher and Outlook. It supports both the older (OLE2) and new (OOXML - Office Open XML) formats."></a> +</div> +<!--+ + |end Project Logo + +--> +<!--+ + |start Search + +--> +<div class="searchbox"> +<form action="http://www.google.com/search" method="get" class="roundtopsmall"> +<input value="poi.apache.org" name="sitesearch" type="hidden"><input onFocus="getBlank (this, 'Search the site with google');" size="25" name="q" id="query" type="text" value="Search the site with google"> + <input name="Search" value="Search" type="submit"> +</form> </div> -</td> -<!--================= end Project Logo ==================--> -</tr> -</tbody> -</table> +<!--+ + |end search + +--> +<!--+ + |start Tabs + +--> +<ul id="tabs"> +<li> +<a class="unselected" href="../../index.html">Home</a> +</li> +<li> +<a class="unselected" href="../../help/index.html">Help</a> +</li> +<li class="current"> +<a class="selected" href="../../components/index.html">Component APIs</a> +</li> +<li> +<a class="unselected" href="../../devel/index.html">Getting Involved</a> +</li> +</ul> +<!--+ + |end Tabs + +--> +</div> +</div> +<div id="main"> +<div id="publishedStrip"> +<!--+ + |start Subtabs + +--> +<div id="level2tabs"></div> +<!--+ + |end Endtabs + +--> +<script type="text/javascript"><!-- +document.write("Last Published: " + document.lastModified); +// --></script> +</div> +<!--+ + |breadtrail + +--> +<div class="breadtrail"> + + + </div> +<!--+ + |start Menu, mainarea + +--> +<!--+ + |start Menu + +--> +<div id="menu"> +<div onclick="SwitchMenu('menu_selected_1.1', '../../skin/')" id="menu_selected_1.1Title" class="menutitle" style="background-image: url('../../skin/images/chapter_open.gif');">Component APIs</div> +<div id="menu_selected_1.1" class="selectedmenuitemgroup" style="display: block;"> +<div class="menuitem"> +<a href="../../components/index.html">Overview</a> </div> -<!--================= end Banner ==================--> -<!--================= start Main ==================--> -<table width="100%" cellpadding="0" cellspacing="0" border="0" summary="nav" id="breadcrumbs"> -<tbody> -<!--================= start Status ==================--> -<tr class="status"> -<td> -<!--================= start BreadCrumb ==================--><a href="https://www.apache.org/">Apache</a> | <a href="https://poi.apache.org/">POI</a><a href=""></a> -<!--================= end BreadCrumb ==================--></td><td id="tabs"> -<!--================= start Tabs ==================--> -<div class="tab"> -<span class="selectedTab"><a class="base-selected" href="../index.html">Home</a></span> | <script language="Javascript" type="text/javascript"> -function printit() { -if (window.print) { - window.print() ; -} else { - var WebBrowser = '<OBJECT ID="WebBrowser1" WIDTH="0" HEIGHT="0" CLASSID="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></OBJECT>'; -document.body.insertAdjacentHTML('beforeEnd', WebBrowser); - WebBrowser1.ExecWB(6, 2);//Use a 1 vs. a 2 for a prompting dialog box WebBrowser1.outerHTML = ""; -} -} -</script><script language="Javascript" type="text/javascript"> -var NS = (navigator.appName == "Netscape"); -var VERSION = parseInt(navigator.appVersion); -if (VERSION > 3) { - document.write(' <a title="PRINT this page OUT" href="javascript:printit()">PRINT</a>'); -} -</script> +<div class="menuitem"> +<a href="../../apidocs/index.html">Javadocs</a> </div> -<!--================= end Tabs ==================--> -</td> -</tr> -</tbody> -</table> -<!--================= end Status ==================--> -<table id="main" width="100%" cellpadding="8" cellspacing="0" summary="" border="0"> -<tbody> -<tr valign="top"> -<!--================= start Menu ==================--> -<td id="leftcol"> -<div id="navcolumn"> -<div class="menuBar"> -<div class="menu"> -<span class="menuLabel">Apache POI</span> - -<div class="menuItem"> -<a href="../index.html">Top</a> +<div onclick="SwitchMenu('menu_1.1.3', '../../skin/')" id="menu_1.1.3Title" class="menutitle">Excel (HSSF/XSSF)</div> +<div id="menu_1.1.3" class="menuitemgroup"> +<div class="menuitem"> +<a href="../../components/spreadsheet/index.html">Overview</a> </div> - +<div class="menuitem"> +<a href="../../components/spreadsheet/quick-guide.html">Quick Guide</a> </div> -<div class="menu"> -<span class="menuLabel">POIFS</span> - -<div class="menuItem"> -<a href="index.html">Overview</a> +<div class="menuitem"> +<a href="../../components/spreadsheet/how-to.html">HOWTO</a> </div> - -<div class="menuItem"> -<a href="how-to.html">How To</a> +<div class="menuitem"> +<a href="../../components/spreadsheet/converting.html">HSSF to SS Converting</a> </div> - -<div class="menuItem"> -<a href="embeded.html">Embedded Documents</a> +<div class="menuitem"> +<a href="../../components/spreadsheet/formula.html">Formula Support</a> </div> - -<div class="menuItem"> -<span class="menuSelected">File System Documentation</span> +<div class="menuitem"> +<a href="../../components/spreadsheet/eval.html">Formula Evaluation</a> </div> - -<div class="menuItem"> -<a href="usecases.html">Use Cases</a> +<div class="menuitem"> +<a href="../../components/spreadsheet/eval-devguide.html">Eval Dev Guide</a> </div> - +<div class="menuitem"> +<a href="../../components/spreadsheet/examples.html">Examples</a> </div> -<center> -<a href="https://www.apache.org/events/current-event.html"><img src="https://www.apache.org/events/current-event-125x125.png"></a> -</center> +<div class="menuitem"> +<a href="../../components/spreadsheet/use-case.html">Use Case</a> </div> +<div class="menuitem"> +<a href="../../components/spreadsheet/diagrams.html">Pictorial Docs</a> </div> -<form target="_blank" action="https://www.google.com/search" method="get"> -<table summary="search" border="0" cellspacing="0" cellpadding="0"> -<tr> -<td><img height="1" width="1" alt="" src="../skin/images/spacer.gif" class="spacer"></td><td nowrap="nowrap"> - Search Apache POI<br> -<input value="poi.apache.org" name="sitesearch" type="hidden"><input size="10" name="q" id="query" type="text"><img height="1" width="5" alt="" src="../skin/images/spacer.gif" class="spacer"><input name="Search" value="GO" type="submit"></td><td><img height="1" width="1" alt="" src="../skin/images/spacer.gif" class="spacer"></td> -</tr> -<tr> -<td colspan="3"><img height="7" width="1" alt="" src="../skin/images/spacer.gif" class="spacer"></td> -</tr> -<tr> -<td class="bottom-left-thick"></td><td bgcolor="#a5b6c6"><img height="1" width="1" alt="" src="../skin/images/spacer.gif" class="spacer"></td><td class="bottom-right-thick"></td> -</tr> -</table> -</form> -</td> -<!--================= end Menu ==================--> -<!--================= start Content ==================--><td> -<div id="bodycol"> -<div class="app"> -<div align="center"> -<h1>POIFS File System Internals</h1> +<div class="menuitem"> +<a href="../../components/spreadsheet/limitations.html">Limitations</a> </div> -<div class="h3"> - - +<div class="menuitem"> +<a href="../../components/spreadsheet/user-defined-functions.html">User Defined Functions</a> +</div> +<div class="menuitem"> +<a href="../../components/spreadsheet/excelant.html">ExcelAnt Tests</a> +</div> +<div class="menuitem"> +<a href="../../components/spreadsheet/hacking-hssf.html">Hacking HSSF</a> +</div> +<div class="menuitem"> +<a href="../../components/spreadsheet/record-generator.html">Record Generator</a> +</div> +<div class="menuitem"> +<a href="../../components/spreadsheet/chart.html">Charts</a> +</div> +</div> +<div onclick="SwitchMenu('menu_1.1.4', '../../skin/')" id="menu_1.1.4Title" class="menutitle">PowerPoint (HSLF/XSLF)</div> +<div id="menu_1.1.4" class="menuitemgroup"> +<div class="menuitem"> +<a href="../../components/slideshow/index.html">Overview</a> +</div> +<div class="menuitem"> +<a href="../../components/slideshow/quick-guide.html">Quick Guide</a> +</div> +<div class="menuitem"> +<a href="../../components/slideshow/how-to-shapes.html">HSLF Cookbook</a> +</div> +<div class="menuitem"> +<a href="../../components/slideshow/xslf-cookbook.html">XSLF Cookbook</a> +</div> +<div class="menuitem"> +<a href="../../components/slideshow/ppt-file-format.html">PPT File Format</a> +</div> +</div> +<div onclick="SwitchMenu('menu_1.1.5', '../../skin/')" id="menu_1.1.5Title" class="menutitle">Word (HWPF/XWPF)</div> +<div id="menu_1.1.5" class="menuitemgroup"> +<div class="menuitem"> +<a href="../../components/document/index.html">Overview</a> +</div> +<div class="menuitem"> +<a href="../../components/document/quick-guide.html">HWPF Quick Guide</a> +</div> +<div class="menuitem"> +<a href="../../components/document/quick-guide-xwpf.html">XWPF Quick Guide</a> +</div> +<div class="menuitem"> +<a href="../../components/document/docoverview.html">HWPF Format</a> +</div> +<div class="menuitem"> +<a href="../../components/document/projectplan.html">HWPF Project plan</a> +</div> +</div> +<div class="menuitem"> +<a href="../../components/hsmf/index.html">Outlook (HSMF)</a> +</div> +<div class="menuitem"> +<a href="../../components/diagram/index.html">Visio (HDGF+XDGF)</a> +</div> +<div onclick="SwitchMenu('menu_1.1.8', '../../skin/')" id="menu_1.1.8Title" class="menutitle">Publisher (HPBF)</div> +<div id="menu_1.1.8" class="menuitemgroup"> +<div class="menuitem"> +<a href="../../components/hpbf/index.html">Overview</a> +</div> +<div class="menuitem"> +<a href="../../components/hpbf/file-format.html">File Format</a> +</div> +</div> +<div onclick="SwitchMenu('menu_selected_1.1.9', '../../skin/')" id="menu_selected_1.1.9Title" class="menutitle" style="background-image: url('../../skin/images/chapter_open.gif');">OLE2 Filesystem (POIFS)</div> +<div id="menu_selected_1.1.9" class="selectedmenuitemgroup" style="display: block;"> +<div class="menuitem"> +<a href="../../components/poifs/index.html">Overview</a> +</div> +<div class="menuitem"> +<a href="../../components/poifs/how-to.html">How To</a> +</div> +<div class="menuitem"> +<a href="../../components/poifs/embeded.html">Embedded Documents</a> +</div> +<div class="menupage"> +<div class="menupagetitle">File System Documentation</div> +</div> +<div class="menuitem"> +<a href="../../components/poifs/usecases.html">Use Cases</a> +</div> +<div class="menuitem"> +<a href="../../components/poifs/design.html">Design</a> +</div> +</div> +<div onclick="SwitchMenu('menu_1.1.10', '../../skin/')" id="menu_1.1.10Title" class="menutitle">OLE2 Document Props (HPSF)</div> +<div id="menu_1.1.10" class="menuitemgroup"> +<div class="menuitem"> +<a href="../../components/hpsf/index.html">Overview</a> +</div> +<div class="menuitem"> +<a href="../../components/hpsf/how-to.html">How To</a> +</div> +<div class="menuitem"> +<a href="../../components/hpsf/thumbnails.html">Thumbnails</a> +</div> +<div class="menuitem"> +<a href="../../components/hpsf/internals.html">Internals</a> +</div> +<div class="menuitem"> +<a href="../../components/hpsf/todo.html">To Do</a> +</div> +</div> +<div class="menuitem"> +<a href="../../components/hmef/index.html">TNEF (HMEF) for winmail.dat</a> +</div> +<div class="menuitem"> +<a href="../../components/oxml4j/index.html">OpenXML4J (OOXML)</a> +</div> +<div class="menuitem"> +<a href="../../components/logging.html">Logging framework</a> +</div> +</div> +<div id="credit"></div> +<div id="roundbottom"> +<img style="display: none" class="corner" height="15" width="15" alt="" src="../../skin/images/rc-b-l-15-1body-2menu-3menu.png"></div> +<!--+ + |alternative credits + +--> +<div id="credit2"> +<a href="https://donate.apache.org/"><img border="0" title="Support Apache" alt="Support Apache - logo" src="../../images/support-asf.png" style="width: 125px;height: 125px;"></a> +</div> +</div> +<!--+ + |end Menu + +--> +<!--+ + |start content + +--> +<div id="content"> +<h1>POIFS File System Internals</h1> +<div id="front-matter"></div> <a name="POIFS+File+System+Internals"></a> -<div class="h3"> -<h3>POIFS File System Internals<a title="Permanent link" class="headerlink" href="#POIFS+File+System+Internals">#</a> -</h3> -</div> - +<h2 class="boxed">POIFS File System Internals</h2> +<div class="section"> <a name="Introduction"></a> -<div class="h4"> -<h4>Introduction<a title="Permanent link" class="headerlink" href="#Introduction">#</a> -</h4> -</div> - +<h3 class="boxed">Introduction</h3> <p>POIFS file systems are essentially normal files stored on a Java-compatible platform's native file system. They are typically identified by names ending in a four character @@ -164,7 +303,6 @@ if (VERSION > 3) { POIFS archives. For the remainder of this document it is referred to as a file system in order to avoid confusion with the "files" it contains.</p> - <p>POIFS file systems are compatible with those document formats used by a well-known software company's popular office productivity suite and programs outputting @@ -172,31 +310,22 @@ if (VERSION > 3) { provide compression, encryption or any other worthwhile feature, its not a good choice unless you require interoperability with these programs.</p> - <p>The POIFS file system does not encode the documents themselves. For example, if you had a word processor file with the extension ".doc", you would actually have a POIFS file system with a document file archived inside of that file system.</p> - <p>Note - this document is a good overview and explanation of the file format, but for the very nitty-gritty details, you should refer to <a href="http://msdn.microsoft.com/en-us/library/dd942138%28v=prot.13%29.aspx">[MS-CFB].pdf</a> in the (now public) Microsoft Documentation.</p> - - <a name="Document+Conventions"></a> -<div class="h4"> -<h4>Document Conventions<a title="Permanent link" class="headerlink" href="#Document+Conventions">#</a> -</h4> -</div> - +<h3 class="boxed">Document Conventions</h3> <p>This document utilizes the numeric types as described by the Java Language Specification, which can be found at <a href="http://java.sun.com">http://java.sun.com</a>. In short:</p> - <ul> <li>A <em>byte</em> is an 8 bit signed integer ranging from @@ -212,10 +341,8 @@ if (VERSION > 3) { -9.22E18 to 9.22E18.</li> </ul> - <p>The Java Language Specification spells out a number of other types that are not referred to by this document.</p> - <p>Where this document makes references to "endian conversion" it is referring to the byte order of stored numbers. Numbers in "little-endian order" @@ -225,29 +352,20 @@ if (VERSION > 3) { before performing an <span class="codefrag">or</span> operation to it against the first byte. The following code illustrates this method:</p> - <pre class="code"> public int getShort (byte[] rec) { return ((rec[1] << 8) | (rec[0] & 0x00ff)); }</pre> - - <a name="File+System+Walkthrough"></a> -<div class="h4"> -<h4>File System Walkthrough<a title="Permanent link" class="headerlink" href="#File+System+Walkthrough">#</a> -</h4> -</div> - +<h3 class="boxed">File System Walkthrough</h3> <p>This is a walkthrough of a POIFS file system and how it is put together. It is not intended to give a concise description but to give a "big picture" of the general structure and how it's interpreted.</p> - <p>A POIFS file system begins with a header. This header identifies locations in the file by function and provides a sanity check identifying a file as a POIFS file system.</p> - <p>The first 64 bits of the header compose a <em>magic number identifier.</em> This identifier tells the client software that this is indeed a POIFS file system and that it should @@ -260,7 +378,6 @@ public int getShort (byte[] rec) pointer to the first element in the <em>property table</em>, also known as the <em>root element</em>, and a pointer to the <em>small Block Allocation Table (SBAT)</em>.</p> - <p>The <em>block allocation table</em> or <em>BAT</em>, along with the <em>property table</em>, specify which blocks in the file system belong to which files. After the header block, the @@ -274,7 +391,6 @@ public int getShort (byte[] rec) index of the next block in the array (and thus the index of the next BAT value). A special value is stored in the BAT to indicate "end of file".</p> - <p>The <em>property table</em> is essentially the directory storage for the file system. It consists of the name of the file or directory, its <em>start block</em> in both the file @@ -283,20 +399,13 @@ public int getShort (byte[] rec) element</em>. It has two purposes: to be a directory entry (the root of the directory tree, to be specific), and to hold the start block for the <em>small block data</em>.</p> - <p>Small block data is a special file that contains the data for small files (less than 4K bytes). It subdivides its blocks into smaller blocks and there is a special small block allocation table that, like the main BAT for larger files, is used to map a small file to its small blocks.</p> - - <a name="Header+Block"></a> -<div class="h4"> -<h4>Header Block<a title="Permanent link" class="headerlink" href="#Header+Block">#</a> -</h4> -</div> - +<h3 class="boxed">Header Block</h3> <p>The POIFS file system begins with a <em>header block</em>. The first 64 bits of the header form a long <em>file type id</em> or <em>magic number identifier</em> of @@ -305,30 +414,18 @@ public int getShort (byte[] rec) (and consequently the file system) then this is not a POIFS file system and should be read with some other library.</p> - <p>It's important to know the most important parts of the header. These are discussed in the rest of this section.</p> - <a name="BATs"></a> -<div class="h2"> -<h2>BATs<a title="Permanent link" class="headerlink" href="#BATs">#</a> -</h2> -</div> - +<h4>BATs</h4> <p>At offset <em>0x2C</em> is an int specifying the number of elements in the <em>BAT array</em>. The array at <em>0x4C</em> an array of ints. This array contains the indices of every block in the Block Allocation Table.</p> - - <a name="XBATs"></a> -<div class="h2"> -<h2>XBATs<a title="Permanent link" class="headerlink" href="#XBATs">#</a> -</h2> -</div> - +<h4>XBATs</h4> <p>Very large POIFS archives may have more blocks than can be addressed by the BAT blocks enumerated in the header block. How large? Well, the BAT array in the header can @@ -346,7 +443,6 @@ public int getShort (byte[] rec) blocks begin at the specified index into the array of blocks making up the POIFS file system, and are chained for the specified count of XBAT blocks.</p> - <p>Each XBAT block contains the indices of up to 127 BAT blocks, so the document size can be expanded by another ~8MB for each XBAT block. The BAT blocks indexed by an @@ -357,12 +453,10 @@ public int getShort (byte[] rec) XBAT block are BAT blocks 109 through 235, the BAT blocks enumerated in the second XBAT block are BAT blocks 236 through 362, and so on.</p> - <p>While a normal BAT block holds 128 entries, each XBAT only references 127 BAT blocks. The last, 128th entry in an XBAT is the offset to the next XBAT block in the chain (or -1 if this is the last XBAT).</p> - <p>Through the use of XBAT blocks, the limit on the overall document size is that imposed by the 4-byte block indices; if the indices are unsigned ints, the @@ -371,14 +465,8 @@ public int getShort (byte[] rec) yet to see a disk drive large enough to accommodate such a file on the shelves at the local office supply stores.</p> - - <a name="SBATs"></a> -<div class="h2"> -<h2>SBATs<a title="Permanent link" class="headerlink" href="#SBATs">#</a> -</h2> -</div> - +<h4>SBATs</h4> <p>If a file contained in a POIFS archive is smaller than 4096 bytes, it is stored in small blocks. Small blocks are 64 bytes in length and are contained within big @@ -391,35 +479,21 @@ public int getShort (byte[] rec) walking the main BAT as if it were an ordinary file in the POIFS file system (this process is described below).</p> - - <a name="Property+Table+Start+Index"></a> -<div class="h2"> -<h2>Property Table Start Index<a title="Permanent link" class="headerlink" href="#Property+Table+Start+Index">#</a> -</h2> -</div> - +<h4>Property Table Start Index</h4> <p>An integer at address <em>0x30</em> specifies the start index of the property table. This integer is specified as a <em>"block index"</em>. The Property Table is stored, as is almost everything in a POIFS file system, in big blocks and walked via the BAT. The Property Table is described below.</p> - - - <a name="Property+Table"></a> -<div class="h4"> -<h4>Property Table<a title="Permanent link" class="headerlink" href="#Property+Table">#</a> -</h4> -</div> - +<h3 class="boxed">Property Table</h3> <p>The property table is essentially nothing more than the directory system. Properties are 128 byte records contained within the 512 byte blocks. The first property is always the Root Entry. The following applies to individual properties within a property table:</p> - <ul> <li>At offset <em>0x00</em> in the property is the @@ -487,14 +561,8 @@ public int getShort (byte[] rec) file.</li> </ul> - - <a name="Root+Entry"></a> -<div class="h4"> -<h4>Root Entry<a title="Permanent link" class="headerlink" href="#Root+Entry">#</a> -</h4> -</div> - +<h3 class="boxed">Root Entry</h3> <p>The <em>Root Entry</em> in the <em>Property Table</em> contains the information necessary to read and write small files, which are files less than 4096 bytes @@ -507,14 +575,8 @@ public int getShort (byte[] rec) Block Array are divided into 64-byte small blocks, up to the size indicated in the Root Entry (which should always be a multiple of 64).</p> - - <a name="Walking+the+Nodes+of+the+Property+Table"></a> -<div class="h4"> -<h4>Walking the Nodes of the Property Table<a title="Permanent link" class="headerlink" href="#Walking+the+Nodes+of+the+Property+Table">#</a> -</h4> -</div> - +<h3 class="boxed">Walking the Nodes of the Property Table</h3> <p>The individual properties form a directory tree, with the <em>Root Entry</em> as the directory tree's root, as shown in the accompanying drawing. Note the numbers in @@ -522,10 +584,8 @@ public int getShort (byte[] rec) in the array of properties. The <em>NEXT_PROP</em>, <em>PREVIOUS_PROP</em>, and <em>CHILD_PROP</em> fields hold these indices, and are used to navigate the tree.</p> - <p> <img alt="property set" src="images/PropertySet.jpg"></p> - <p>Each directory entry (i.e., a property whose type is <em>directory</em> or <em>root entry</em>) uses its <em>CHILD_PROP</em> field to point to one of its @@ -536,23 +596,15 @@ public int getShort (byte[] rec) the directory node (index 1) may have, in its CHILD_PROP field, 2, 3, or the index of one of its other children.</p> - <p>The children of a given directory property point to each other in a similar fashion by using their <em>NEXT_PROP</em> and <em>PREVIOUS_PROP</em> fields.</p> - <p>Unused <em>NEXT_PROP</em>, <em>PREVIOUS_PROP</em>, and <em>CHILD_PROP</em> fields contain the marker value of -1. All file properties have a value of -1 for their CHILD_PROP fields for example.</p> - - <a name="Block+Allocation+Table"></a> -<div class="h4"> -<h4>Block Allocation Table<a title="Permanent link" class="headerlink" href="#Block+Allocation+Table">#</a> -</h4> -</div> - +<h3 class="boxed">Block Allocation Table</h3> <p>The <em>BAT blocks</em> are pointed at by the bat array contained in the header and supplemented, if necessary, by the <em>XBAT blocks</em>. These blocks form a large @@ -568,46 +620,35 @@ public int getShort (byte[] rec) a linked list of blocks. The BAT array contains the links from one block to the next, including the end of chain marker.</p> - <p>Here's an example: Let's assume that the BAT begins as follows:</p> - <p> <span class="codefrag">BAT[ 0 ] = 2</span> </p> - <p> <span class="codefrag">BAT[ 1 ] = 5</span> </p> - <p> <span class="codefrag">BAT[ 2 ] = 3</span> </p> - <p> <span class="codefrag">BAT[ 3 ] = 4</span> </p> - <p> <span class="codefrag">BAT[ 4 ] = 6</span> </p> - <p> <span class="codefrag">BAT[ 5 ] = -2</span> </p> - <p> <span class="codefrag">BAT[ 6 ] = 7</span> </p> - <p> <span class="codefrag">BAT[ 7 ] = -2</span> </p> - <p> <span class="codefrag">...</span> </p> - <p>Now, if we have a file whose Property Table entry says it begins with index 0, we walk the BAT array and see that the file consists of blocks 0 (because the start block is @@ -615,12 +656,9 @@ public int getShort (byte[] rec) 3 ] is 4), 6 (BAT[ 4 ] is 6), and 7 (BAT[ 6 ] is 7). It ends at block 7 because BAT[ 7 ] is -2, which is the end of chain marker.</p> - <p>Similarly, a file beginning at index 1 consists of blocks 1 and 5.</p> - <p>Other special numbers in a BAT array are:</p> - <ul> <li>-1, which indicates an unused block</li> @@ -630,25 +668,14 @@ public int getShort (byte[] rec) Property Table, the main BAT, or the SBAT</li> </ul> - - <a name="File+System+Structures"></a> -<div class="h4"> -<h4>File System Structures<a title="Permanent link" class="headerlink" href="#File+System+Structures">#</a> -</h4> -</div> - +<h3 class="boxed">File System Structures</h3> <p>The following outlines the basic file system structures.</p> - <a name="Header+%28block+1%29+--+512+%280x200%29+bytes"></a> -<div class="h2"> -<h2>Header (block 1) -- 512 (0x200) bytes<a title="Permanent link" class="headerlink" href="#Header+%28block+1%29+--+512+%280x200%29+bytes">#</a> -</h2> -</div> - +<h4>Header (block 1) -- 512 (0x200) bytes</h4> <table class="ForrestTable" cellspacing="1" cellpadding="4"> -<tr class="b"> +<tr> <td colspan="1" rowspan="1"><em>Field</em></td> <td colspan="1" rowspan="1"><em>Description</em></td> @@ -658,7 +685,7 @@ public int getShort (byte[] rec) </tr> -<tr class="a"> +<tr> <td colspan="1" rowspan="1">FILETYPE</td> <td colspan="1" rowspan="1">Magic number identifying this as a POIFS file @@ -669,7 +696,7 @@ public int getShort (byte[] rec) </tr> -<tr class="b"> +<tr> <td colspan="1" rowspan="1">UK1</td> <td colspan="1" rowspan="1">Unknown constant</td> @@ -679,7 +706,7 @@ public int getShort (byte[] rec) </tr> -<tr class="a"> +<tr> <td colspan="1" rowspan="1">UK2</td> <td colspan="1" rowspan="1">Unknown Constant</td> @@ -689,7 +716,7 @@ public int getShort (byte[] rec) </tr> -<tr class="b"> +<tr> <td colspan="1" rowspan="1">UK3</td> <td colspan="1" rowspan="1">Unknown Constant</td> @@ -699,7 +726,7 @@ public int getShort (byte[] rec) </tr> -<tr class="a"> +<tr> <td colspan="1" rowspan="1">UK4</td> <td colspan="1" rowspan="1">Unknown Constant (revision?)</td> @@ -709,7 +736,7 @@ public int getShort (byte[] rec) </tr> -<tr class="b"> +<tr> <td colspan="1" rowspan="1">UK5</td> <td colspan="1" rowspan="1">Unknown Constant (version?)</td> @@ -719,7 +746,7 @@ public int getShort (byte[] rec) </tr> -<tr class="a"> +<tr> <td colspan="1" rowspan="1">UK6</td> <td colspan="1" rowspan="1">Unknown Constant</td> @@ -729,7 +756,7 @@ public int getShort (byte[] rec) </tr> -<tr class="b"> +<tr> <td colspan="1" rowspan="1">LOG_2_BIG_BLOCK_SIZE</td> <td colspan="1" rowspan="1">Log, base 2, of the big block size</td> @@ -739,7 +766,7 @@ public int getShort (byte[] rec) </tr> -<tr class="a"> +<tr> <td colspan="1" rowspan="1">LOG_2_SMALL_BLOCK_SIZE</td> <td colspan="1" rowspan="1">Log, base 2, of the small block size</td> @@ -749,7 +776,7 @@ public int getShort (byte[] rec) </tr> -<tr class="b"> +<tr> <td colspan="1" rowspan="1">UK7</td> <td colspan="1" rowspan="1">Unknown Constant</td> @@ -759,7 +786,7 @@ public int getShort (byte[] rec) </tr> -<tr class="a"> +<tr> <td colspan="1" rowspan="1">UK8</td> <td colspan="1" rowspan="1">Unknown Constant</td> @@ -769,7 +796,7 @@ public int getShort (byte[] rec) </tr> -<tr class="b"> +<tr> <td colspan="1" rowspan="1">BAT_COUNT</td> <td colspan="1" rowspan="1">Number of elements in the BAT array</td> @@ -779,7 +806,7 @@ public int getShort (byte[] rec) </tr> -<tr class="a"> +<tr> <td colspan="1" rowspan="1">PROPERTIES_START</td> <td colspan="1" rowspan="1">Block index of the first block of the property @@ -790,7 +817,7 @@ public int getShort (byte[] rec) </tr> -<tr class="b"> +<tr> <td colspan="1" rowspan="1">UK9</td> <td colspan="1" rowspan="1">Unknown Constant</td> @@ -800,7 +827,7 @@ public int getShort (byte[] rec) </tr> -<tr class="a"> +<tr> <td colspan="1" rowspan="1">UK10</td> <td colspan="1" rowspan="1">Unknown Constant</td> @@ -810,7 +837,7 @@ public int getShort (byte[] rec) </tr> -<tr class="b"> +<tr> <td colspan="1" rowspan="1">SBAT_START</td> <td colspan="1" rowspan="1">Block index of first big block containing the small @@ -821,7 +848,7 @@ public int getShort (byte[] rec) </tr> -<tr class="a"> +<tr> <td colspan="1" rowspan="1">SBAT_Block_Count</td> <td colspan="1" rowspan="1">Number of big blocks holding the SBAT</td> @@ -831,7 +858,7 @@ public int getShort (byte[] rec) </tr> -<tr class="b"> +<tr> <td colspan="1" rowspan="1">XBAT_START</td> <td colspan="1" rowspan="1">Block index of the first block in the Extended Block @@ -842,7 +869,7 @@ public int getShort (byte[] rec) </tr> -<tr class="a"> +<tr> <td colspan="1" rowspan="1">XBAT_COUNT</td> <td colspan="1" rowspan="1">Number of elements in the Extended Block Allocation @@ -853,7 +880,7 @@ public int getShort (byte[] rec) </tr> -<tr class="b"> +<tr> <td colspan="1" rowspan="1">BAT_ARRAY</td> <td colspan="1" rowspan="1">Array of block indices constituting the Block @@ -865,7 +892,7 @@ public int getShort (byte[] rec) </tr> -<tr class="a"> +<tr> <td colspan="1" rowspan="1">N/A</td> <td colspan="1" rowspan="1">Header block data not otherwise described in this @@ -877,18 +904,11 @@ public int getShort (byte[] rec) </tr> </table> - - <a name="Block+Allocation+Table+Block+--+512+%280x200%29+bytes"></a> -<div class="h2"> -<h2>Block Allocation Table Block -- 512 (0x200) bytes<a title="Permanent link" class="headerlink" href="#Block+Allocation+Table+Block+--+512+%280x200%29+bytes">#</a> -</h2> -</div> - - +<h4>Block Allocation Table Block -- 512 (0x200) bytes</h4> <table class="ForrestTable" cellspacing="1" cellpadding="4"> -<tr class="b"> +<tr> <td colspan="1" rowspan="1"> <em>Field</em> @@ -908,7 +928,7 @@ public int getShort (byte[] rec) </tr> -<tr class="a"> +<tr> <td colspan="1" rowspan="1">BAT_ELEMENT</td> <td colspan="1" rowspan="1">Any given element in the BAT block</td> @@ -926,17 +946,11 @@ public int getShort (byte[] rec) </tr> </table> - - <a name="Property+Block+--+512+%280x200%29+byte+block"></a> -<div class="h2"> -<h2>Property Block -- 512 (0x200) byte block<a title="Permanent link" class="headerlink" href="#Property+Block+--+512+%280x200%29+byte+block">#</a> -</h2> -</div> - +<h4>Property Block -- 512 (0x200) byte block</h4> <table class="ForrestTable" cellspacing="1" cellpadding="4"> -<tr class="b"> +<tr> <td colspan="1" rowspan="1"><em>Field</em></td> <td colspan="1" rowspan="1"><em>Description</em></td> @@ -946,7 +960,7 @@ public int getShort (byte[] rec) </tr> -<tr class="a"> +<tr> <td colspan="1" rowspan="1">Properties[]</td> <td colspan="1" rowspan="1">This block contains the properties.</td> @@ -957,17 +971,11 @@ public int getShort (byte[] rec) </tr> </table> - - <a name="Property+--+128+%280x80%29+byte+block"></a> -<div class="h2"> -<h2>Property -- 128 (0x80) byte block<a title="Permanent link" class="headerlink" href="#Property+--+128+%280x80%29+byte+block">#</a> -</h2> -</div> - +<h4>Property -- 128 (0x80) byte block</h4> <table class="ForrestTable" cellspacing="1" cellpadding="4"> -<tr class="b"> +<tr> <td colspan="1" rowspan="1"><em>Field</em></td> <td colspan="1" rowspan="1"><em>Description</em></td> @@ -977,7 +985,7 @@ public int getShort (byte[] rec) </tr> -<tr class="a"> +<tr> <td colspan="1" rowspan="1">NAME</td> <td colspan="1" rowspan="1">A unicode null-terminated uncompressed 16bit string @@ -990,7 +998,7 @@ public int getShort (byte[] rec) </tr> -<tr class="b"> +<tr> <td colspan="1" rowspan="1">NAME_SIZE</td> <td colspan="1" rowspan="1">Number of characters in the NAME field</td> @@ -1000,7 +1008,7 @@ public int getShort (byte[] rec) </tr> -<tr class="a"> +<tr> <td colspan="1" rowspan="1">PROPERTY_TYPE</td> <td colspan="1" rowspan="1">Property type (directory, file, or root)</td> @@ -1010,7 +1018,7 @@ public int getShort (byte[] rec) </tr> -<tr class="b"> +<tr> <td colspan="1" rowspan="1">NODE_COLOR</td> <td colspan="1" rowspan="1">Node color</td> @@ -1020,7 +1028,7 @@ public int getShort (byte[] rec) </tr> -<tr class="a"> +<tr> <td colspan="1" rowspan="1">PREVIOUS_PROP</td> <td colspan="1" rowspan="1">Previous property index</td> @@ -1030,7 +1038,7 @@ public int getShort (byte[] rec) </tr> -<tr class="b"> +<tr> <td colspan="1" rowspan="1">NEXT_PROP</td> <td colspan="1" rowspan="1">Next property index</td> @@ -1040,7 +1048,7 @@ public int getShort (byte[] rec) </tr> -<tr class="a"> +<tr> <td colspan="1" rowspan="1">CHILD_PROP</td> <td colspan="1" rowspan="1">First child property index</td> @@ -1050,7 +1058,7 @@ public int getShort (byte[] rec) </tr> -<tr class="b"> +<tr> <td colspan="1" rowspan="1">SECONDS_1</td> <td colspan="1" rowspan="1">Seconds component of the created timestamp?</td> @@ -1060,7 +1068,7 @@ public int getShort (byte[] rec) </tr> -<tr class="a"> +<tr> <td colspan="1" rowspan="1">DAYS_1</td> <td colspan="1" rowspan="1">Days component of the created timestamp?</td> @@ -1070,7 +1078,7 @@ public int getShort (byte[] rec) </tr> -<tr class="b"> +<tr> <td colspan="1" rowspan="1">SECONDS_2</td> <td colspan="1" rowspan="1">Seconds component of the modified timestamp?</td> @@ -1080,7 +1088,7 @@ public int getShort (byte[] rec) </tr> -<tr class="a"> +<tr> <td colspan="1" rowspan="1">DAYS_2</td> <td colspan="1" rowspan="1">Days component of the modified timestamp?</td> @@ -1090,7 +1098,7 @@ public int getShort (byte[] rec) </tr> -<tr class="b"> +<tr> <td colspan="1" rowspan="1">START_BLOCK</td> <td colspan="1" rowspan="1">Starting block of the file, used as the first block @@ -1102,7 +1110,7 @@ public int getShort (byte[] rec) </tr> -<tr class="a"> +<tr> <td colspan="1" rowspan="1">SIZE</td> <td colspan="1" rowspan="1">Actual size of the file this property points @@ -1115,52 +1123,37 @@ public int getShort (byte[] rec) </tr> </table> - - - - - -<div id="authors" align="right">by Marc Johnson</div> </div> + +<p align="right"> +<font size="-2">by Marc Johnson</font> +</p> </div> +<!--+ + |end content + +--> +<div class="clearboth"> </div> </div> -</td> -<!--================= end Content ==================--> -</tr> -</tbody> -</table> -<!--================= end Main ==================--> -<!--================= start Footer ==================--> <div id="footer"> -<table summary="footer" cellspacing="0" cellpadding="4" width="100%" border="0"> -<tbody> -<tr> -<!--================= start Copyright ==================--> -<td colspan="2"> -<div align="center"> +<!--+ + |start bottomstrip + +--> +<div class="lastmodified"> +<script type="text/javascript"><!-- +document.write("Last Published: " + document.lastModified); +// --></script> +</div> <div class="copyright"> - Copyright © 2002-2018 The Apache Software Foundation. All rights reserved.<br> - Apache, Apache POI, and the Apache POI logo are registered trademarks or - trademarks of The Apache Software Foundation in the U.S. and/or other countries. - </div> -</div> -</td> -<!--================= end Copyright ==================--> -</tr> -<tr> -<td align="left"> -<!--================= start Host ==================--> -<!--================= end Host ==================--></td><td align="right"> -<!--================= start Credits ==================--> -<div align="right"> -<div class="credit"></div> + Copyright © + 2001-2018 <a href="https://www.apache.org/">The Apache Software Foundation</a> </div> -<!--================= end Credits ==================--> -</td> -</tr> -</tbody> -</table> +<div id="feedback"> + Send feedback about the website to: + <a id="feedbackto" href="mailto:[email protected]?subject=Feedback%C2%A0components/poifs/fileformat.html">[email protected]</a> +</div> +<!--+ + |end bottomstrip + +--> </div> -<!--================= end Footer ==================--> </body> </html> --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
