本文整理汇总了Java中org.apache.poi.poifs.filesystem.POIFSFileSystem.getRoot方法的典型用法代码示例。如果您正苦于以下问题:Java POIFSFileSystem.getRoot方法的具体用法?Java POIFSFileSystem.getRoot怎么用?Java POIFSFileSystem.getRoot使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.poi.poifs.filesystem.POIFSFileSystem
的用法示例。
在下文中一共展示了POIFSFileSystem.getRoot方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: create
import org.apache.poi.poifs.filesystem.POIFSFileSystem; //导入方法依赖的package包/类
@Override
public TreeModelSource create(final POIFSFileSystem poifs, final DefaultMutableTreeNode parent) {
final DirectoryNode dn = poifs.getRoot();
if (dn.hasEntry(DocumentSummaryInformation.DEFAULT_STREAM_NAME) ||
dn.hasEntry(SummaryInformation.DEFAULT_STREAM_NAME)) {
return appContext.getBean(HPSFTreeModel.class, parent);
}
return null;
}
示例2: writeWordFile
import org.apache.poi.poifs.filesystem.POIFSFileSystem; //导入方法依赖的package包/类
public static boolean writeWordFile(String content,String filename,String path,String examPaperName) throws IOException{
String head = "<html><div style=\"text-align: center\"><span style=\"font-size: 28px\"><span style=\"font-family: 黑体\">" + examPaperName +
"<br /> <br /> </span></span></div>";
String tail = "</html>";
content = head + content + tail;
content = exampaper_formater(content);
ByteArrayInputStream bais = null;
FileOutputStream ostream = null;
try{
if (!"".equals(path)){
File fileDir = new File(path);
if(!fileDir.exists())
fileDir.mkdirs();
if (fileDir.exists()) {
String fileName = filename;
byte b[] = content.getBytes("GBK");
bais = new ByteArrayInputStream(b);
POIFSFileSystem poifs = new POIFSFileSystem();
DirectoryEntry directory = poifs.getRoot();
DocumentEntry documentEntry = directory.createDocument("WordDocument", bais);
ostream = new FileOutputStream(path+ fileName);
poifs.writeFilesystem(ostream);
bais.close();
ostream.close();
}
}
}catch(IOException e){
bais.close();
ostream.close();
e.printStackTrace();
throw e;
}
return true;
}
示例3: createSummaryInformation
import org.apache.poi.poifs.filesystem.POIFSFileSystem; //导入方法依赖的package包/类
public static void createSummaryInformation(String filePath, String title) {
if (filePath == null) {
return;
}
try {
File poiFilesystem = new File(filePath);
InputStream is = new FileInputStream(poiFilesystem);
POIFSFileSystem poifs = new POIFSFileSystem(is);
is.close();
DirectoryEntry dir = poifs.getRoot();
SummaryInformation si = PropertySetFactory.newSummaryInformation();
si.setTitle(title);
si.setAuthor(ReleaseInfoAdapter.getCompany());
si.setApplicationName("NextReports " + ReleaseInfoAdapter.getVersionNumber());
si.setSubject("Created by NextReports Designer" + ReleaseInfoAdapter.getVersionNumber());
si.setCreateDateTime(new Date());
si.setKeywords(ReleaseInfoAdapter.getHome());
si.write(dir, SummaryInformation.DEFAULT_STREAM_NAME);
OutputStream out = new FileOutputStream(poiFilesystem);
poifs.writeFilesystem(out);
out.close();
}
catch (Exception ex) {
ex.printStackTrace();
}
}
示例4: CompoundFileWriter
import org.apache.poi.poifs.filesystem.POIFSFileSystem; //导入方法依赖的package包/类
/**
* 생성자
*/
public CompoundFileWriter() {
fs = new POIFSFileSystem();
currentStorage = fs.getRoot();
}
示例5: HPBFDocument
import org.apache.poi.poifs.filesystem.POIFSFileSystem; //导入方法依赖的package包/类
/**
* Opens a new publisher document
*/
public HPBFDocument(POIFSFileSystem fs) throws IOException {
this(fs.getRoot());
}
示例6: VisioTextExtractor
import org.apache.poi.poifs.filesystem.POIFSFileSystem; //导入方法依赖的package包/类
public VisioTextExtractor(POIFSFileSystem fs) throws IOException {
this(fs.getRoot());
}
示例7: HDGFDiagram
import org.apache.poi.poifs.filesystem.POIFSFileSystem; //导入方法依赖的package包/类
public HDGFDiagram(POIFSFileSystem fs) throws IOException {
this(fs.getRoot());
}
示例8: HWPFOldDocument
import org.apache.poi.poifs.filesystem.POIFSFileSystem; //导入方法依赖的package包/类
public HWPFOldDocument(POIFSFileSystem fs) throws IOException {
this(fs.getRoot());
}
示例9: CompoundFileReader
import org.apache.poi.poifs.filesystem.POIFSFileSystem; //导入方法依赖的package包/类
/**
* 생성자. MS Compound 파일을 열고, 현재 스토리지를 파일의 root 스토리지로 설정한다.
*
* @param file
* 읽을 파일
* @throws IOException
* 파일 에러
*/
public CompoundFileReader(File file) throws IOException {
fs = new POIFSFileSystem(file);
currentStorage = fs.getRoot();
}
示例10: PowerPointExtractor
import org.apache.poi.poifs.filesystem.POIFSFileSystem; //导入方法依赖的package包/类
/**
* Creates a PowerPointExtractor, from an open POIFSFileSystem
*
* @param fs the POIFSFileSystem containing the PowerPoint document
*/
public PowerPointExtractor(POIFSFileSystem fs) throws IOException {
this(fs.getRoot());
}
示例11: HSLFSlideShow
import org.apache.poi.poifs.filesystem.POIFSFileSystem; //导入方法依赖的package包/类
/**
* Constructs a Powerpoint document from a POIFS Filesystem. Parses the
* document and places all the important stuff into data structures.
*
* @param filesystem the POIFS FileSystem to read from
* @throws IOException if there is a problem while parsing the document.
*/
public HSLFSlideShow(POIFSFileSystem filesystem) throws IOException
{
this(filesystem.getRoot());
}
示例12: Word6Extractor
import org.apache.poi.poifs.filesystem.POIFSFileSystem; //导入方法依赖的package包/类
/**
* Create a new Word Extractor
*
* @param fs
* POIFSFileSystem containing the word file
*/
public Word6Extractor( POIFSFileSystem fs ) throws IOException
{
this( fs.getRoot() );
}
示例13: HWPFDocumentCore
import org.apache.poi.poifs.filesystem.POIFSFileSystem; //导入方法依赖的package包/类
/**
* This constructor loads a Word document from a POIFSFileSystem
*
* @param pfilesystem The POIFSFileSystem that contains the Word document.
* @throws IOException If there is an unexpected IOException from the passed
* in POIFSFileSystem.
*/
public HWPFDocumentCore(POIFSFileSystem pfilesystem) throws IOException
{
this(pfilesystem.getRoot());
}
示例14: HWPFDocument
import org.apache.poi.poifs.filesystem.POIFSFileSystem; //导入方法依赖的package包/类
/**
* This constructor loads a Word document from a POIFSFileSystem
*
* @param pfilesystem The POIFSFileSystem that contains the Word document.
* @throws IOException If there is an unexpected IOException from the passed
* in POIFSFileSystem.
*/
public HWPFDocument(POIFSFileSystem pfilesystem) throws IOException
{
this(pfilesystem.getRoot());
}
示例15: MAPIMessage
import org.apache.poi.poifs.filesystem.POIFSFileSystem; //导入方法依赖的package包/类
/**
* Constructor for reading MSG Files from a POIFS filesystem
* @param fs
* @throws IOException
*/
public MAPIMessage(POIFSFileSystem fs) throws IOException {
this(fs.getRoot());
}