当前位置: 首页>>代码示例>>Java>>正文


Java POIFSFileSystem.getRoot方法代码示例

本文整理汇总了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;
}
 
开发者ID:kiwiwings,项目名称:poi-visualizer,代码行数:10,代码来源:HPSFTreeModelFactory.java

示例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;
}
 
开发者ID:imalexyang,项目名称:ExamStack,代码行数:37,代码来源:Html2Doc.java

示例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();
        }
    }
 
开发者ID:nextreports,项目名称:nextreports-engine,代码行数:31,代码来源:XlsExporter.java

示例4: CompoundFileWriter

import org.apache.poi.poifs.filesystem.POIFSFileSystem; //导入方法依赖的package包/类
/**
 * 생성자
 */
public CompoundFileWriter() {
	fs = new POIFSFileSystem();
	currentStorage = fs.getRoot();
}
 
开发者ID:neolord0,项目名称:hwplib,代码行数:8,代码来源:CompoundFileWriter.java

示例5: HPBFDocument

import org.apache.poi.poifs.filesystem.POIFSFileSystem; //导入方法依赖的package包/类
/**
 * Opens a new publisher document
 */
public HPBFDocument(POIFSFileSystem fs) throws IOException {
   this(fs.getRoot());
}
 
开发者ID:rmage,项目名称:gnvc-ims,代码行数:7,代码来源:HPBFDocument.java

示例6: VisioTextExtractor

import org.apache.poi.poifs.filesystem.POIFSFileSystem; //导入方法依赖的package包/类
public VisioTextExtractor(POIFSFileSystem fs) throws IOException {
	this(fs.getRoot());
}
 
开发者ID:rmage,项目名称:gnvc-ims,代码行数:4,代码来源:VisioTextExtractor.java

示例7: HDGFDiagram

import org.apache.poi.poifs.filesystem.POIFSFileSystem; //导入方法依赖的package包/类
public HDGFDiagram(POIFSFileSystem fs) throws IOException {
	this(fs.getRoot());
}
 
开发者ID:rmage,项目名称:gnvc-ims,代码行数:4,代码来源:HDGFDiagram.java

示例8: HWPFOldDocument

import org.apache.poi.poifs.filesystem.POIFSFileSystem; //导入方法依赖的package包/类
public HWPFOldDocument(POIFSFileSystem fs) throws IOException {
    this(fs.getRoot());
}
 
开发者ID:rmage,项目名称:gnvc-ims,代码行数:4,代码来源:HWPFOldDocument.java

示例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();
}
 
开发者ID:neolord0,项目名称:hwplib,代码行数:13,代码来源:CompoundFileReader.java

示例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());
}
 
开发者ID:rmage,项目名称:gnvc-ims,代码行数:9,代码来源:PowerPointExtractor.java

示例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());
}
 
开发者ID:rmage,项目名称:gnvc-ims,代码行数:12,代码来源:HSLFSlideShow.java

示例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() );
}
 
开发者ID:rmage,项目名称:gnvc-ims,代码行数:11,代码来源:Word6Extractor.java

示例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());
 }
 
开发者ID:rmage,项目名称:gnvc-ims,代码行数:12,代码来源:HWPFDocumentCore.java

示例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());
}
 
开发者ID:rmage,项目名称:gnvc-ims,代码行数:12,代码来源:HWPFDocument.java

示例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());
}
 
开发者ID:rmage,项目名称:gnvc-ims,代码行数:9,代码来源:MAPIMessage.java


注:本文中的org.apache.poi.poifs.filesystem.POIFSFileSystem.getRoot方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。