Browse Source

More NPOIFS Constructor updates

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1085447 13f79535-47bb-0310-9956-ffa450edef68
tags/REL_3_8_BETA2
Nick Burch 13 years ago
parent
commit
27e3d4ea26

+ 14
- 3
src/scratchpad/src/org/apache/poi/hdgf/HDGFDiagram.java View File

import org.apache.poi.hdgf.streams.TrailerStream; import org.apache.poi.hdgf.streams.TrailerStream;
import org.apache.poi.poifs.filesystem.DirectoryNode; import org.apache.poi.poifs.filesystem.DirectoryNode;
import org.apache.poi.poifs.filesystem.DocumentEntry; import org.apache.poi.poifs.filesystem.DocumentEntry;
import org.apache.poi.poifs.filesystem.NPOIFSFileSystem;
import org.apache.poi.poifs.filesystem.POIFSFileSystem; import org.apache.poi.poifs.filesystem.POIFSFileSystem;
import org.apache.poi.util.LittleEndian; import org.apache.poi.util.LittleEndian;


private PointerFactory ptrFactory; private PointerFactory ptrFactory;


public HDGFDiagram(POIFSFileSystem fs) throws IOException { public HDGFDiagram(POIFSFileSystem fs) throws IOException {
this(fs.getRoot(), fs);
this(fs.getRoot());
} }
public HDGFDiagram(DirectoryNode dir, POIFSFileSystem fs) throws IOException {
super(dir, fs);
public HDGFDiagram(NPOIFSFileSystem fs) throws IOException {
this(fs.getRoot());
}
/**
* @deprecated Use {@link #HDGFDiagram(DirectoryNode)} instead
*/
@Deprecated
public HDGFDiagram(DirectoryNode dir, POIFSFileSystem fs) throws IOException {
this(dir);
}
public HDGFDiagram(DirectoryNode dir) throws IOException {
super(dir);


DocumentEntry docProps = DocumentEntry docProps =
(DocumentEntry)dir.getEntry("VisioDocument"); (DocumentEntry)dir.getEntry("VisioDocument");

+ 12
- 3
src/scratchpad/src/org/apache/poi/hdgf/extractor/VisioTextExtractor.java View File

import org.apache.poi.hdgf.streams.PointerContainingStream; import org.apache.poi.hdgf.streams.PointerContainingStream;
import org.apache.poi.hdgf.streams.Stream; import org.apache.poi.hdgf.streams.Stream;
import org.apache.poi.poifs.filesystem.DirectoryNode; import org.apache.poi.poifs.filesystem.DirectoryNode;
import org.apache.poi.poifs.filesystem.NPOIFSFileSystem;
import org.apache.poi.poifs.filesystem.POIFSFileSystem; import org.apache.poi.poifs.filesystem.POIFSFileSystem;


/** /**
*/ */
public final class VisioTextExtractor extends POIOLE2TextExtractor { public final class VisioTextExtractor extends POIOLE2TextExtractor {
private HDGFDiagram hdgf; private HDGFDiagram hdgf;
private POIFSFileSystem fs;


public VisioTextExtractor(HDGFDiagram hdgf) { public VisioTextExtractor(HDGFDiagram hdgf) {
super(hdgf); super(hdgf);
this.hdgf = hdgf; this.hdgf = hdgf;
} }
public VisioTextExtractor(POIFSFileSystem fs) throws IOException { public VisioTextExtractor(POIFSFileSystem fs) throws IOException {
this(fs.getRoot(), fs);
this(fs.getRoot());
} }
public VisioTextExtractor(NPOIFSFileSystem fs) throws IOException {
this(fs.getRoot());
}
public VisioTextExtractor(DirectoryNode dir) throws IOException {
this(new HDGFDiagram(dir));
}
/**
* @deprecated Use {@link #VisioTextExtractor(DirectoryNode)} instead
*/
@Deprecated
public VisioTextExtractor(DirectoryNode dir, POIFSFileSystem fs) throws IOException { public VisioTextExtractor(DirectoryNode dir, POIFSFileSystem fs) throws IOException {
this(new HDGFDiagram(dir, fs)); this(new HDGFDiagram(dir, fs));
this.fs = fs;
} }
public VisioTextExtractor(InputStream inp) throws IOException { public VisioTextExtractor(InputStream inp) throws IOException {
this(new POIFSFileSystem(inp)); this(new POIFSFileSystem(inp));

+ 15
- 0
src/scratchpad/src/org/apache/poi/hslf/HSLFSlideShow.java View File

import org.apache.poi.poifs.filesystem.DirectoryNode; import org.apache.poi.poifs.filesystem.DirectoryNode;
import org.apache.poi.poifs.filesystem.DocumentEntry; import org.apache.poi.poifs.filesystem.DocumentEntry;
import org.apache.poi.poifs.filesystem.DocumentInputStream; import org.apache.poi.poifs.filesystem.DocumentInputStream;
import org.apache.poi.poifs.filesystem.NPOIFSFileSystem;
import org.apache.poi.poifs.filesystem.POIFSFileSystem; import org.apache.poi.poifs.filesystem.POIFSFileSystem;
import org.apache.poi.util.LittleEndian; import org.apache.poi.util.LittleEndian;
import org.apache.poi.util.POILogFactory; import org.apache.poi.util.POILogFactory;
this(filesystem.getRoot()); this(filesystem.getRoot());
} }


/**
* 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(NPOIFSFileSystem filesystem) throws IOException
{
this(filesystem.getRoot());
}

/** /**
* Constructs a Powerpoint document from a specific point in a * Constructs a Powerpoint document from a specific point in a
* POIFS Filesystem. Parses the document and places all the * POIFS Filesystem. Parses the document and places all the
* important stuff into data structures. * important stuff into data structures.
* *
* @deprecated Use {@link #HSLFSlideShow(DirectoryNode)} instead
* @param dir the POIFS directory to read from * @param dir the POIFS directory to read from
* @param filesystem the POIFS FileSystem to read from * @param filesystem the POIFS FileSystem to read from
* @throws IOException if there is a problem while parsing the document. * @throws IOException if there is a problem while parsing the document.
*/ */
@Deprecated
public HSLFSlideShow(DirectoryNode dir, POIFSFileSystem filesystem) throws IOException public HSLFSlideShow(DirectoryNode dir, POIFSFileSystem filesystem) throws IOException
{ {
this(dir); this(dir);

+ 25
- 1
src/scratchpad/src/org/apache/poi/hslf/extractor/PowerPointExtractor.java View File

import org.apache.poi.hslf.model.*; import org.apache.poi.hslf.model.*;
import org.apache.poi.hslf.usermodel.SlideShow; import org.apache.poi.hslf.usermodel.SlideShow;
import org.apache.poi.poifs.filesystem.DirectoryNode; import org.apache.poi.poifs.filesystem.DirectoryNode;
import org.apache.poi.poifs.filesystem.NPOIFSFileSystem;
import org.apache.poi.poifs.filesystem.POIFSFileSystem; import org.apache.poi.poifs.filesystem.POIFSFileSystem;


/** /**
* @param fs the POIFSFileSystem containing the PowerPoint document * @param fs the POIFSFileSystem containing the PowerPoint document
*/ */
public PowerPointExtractor(POIFSFileSystem fs) throws IOException { public PowerPointExtractor(POIFSFileSystem fs) throws IOException {
this(new HSLFSlideShow(fs));
this(fs.getRoot());
} }


/**
* Creates a PowerPointExtractor, from an open NPOIFSFileSystem
*
* @param fs the NPOIFSFileSystem containing the PowerPoint document
*/
public PowerPointExtractor(NPOIFSFileSystem fs) throws IOException {
this(fs.getRoot());
}

/**
* Creates a PowerPointExtractor, from a specific place
* inside an open NPOIFSFileSystem
*
* @param dir the POIFS Directory containing the PowerPoint document
*/
public PowerPointExtractor(DirectoryNode dir) throws IOException {
this(new HSLFSlideShow(dir));
}

/**
* @deprecated Use {@link #PowerPointExtractor(DirectoryNode)} instead
*/
@Deprecated
public PowerPointExtractor(DirectoryNode dir, POIFSFileSystem fs) throws IOException { public PowerPointExtractor(DirectoryNode dir, POIFSFileSystem fs) throws IOException {
this(new HSLFSlideShow(dir, fs)); this(new HSLFSlideShow(dir, fs));
} }

+ 18
- 2
src/scratchpad/src/org/apache/poi/hsmf/MAPIMessage.java View File

import org.apache.poi.hsmf.exceptions.ChunkNotFoundException; import org.apache.poi.hsmf.exceptions.ChunkNotFoundException;
import org.apache.poi.hsmf.parsers.POIFSChunkParser; import org.apache.poi.hsmf.parsers.POIFSChunkParser;
import org.apache.poi.poifs.filesystem.DirectoryNode; import org.apache.poi.poifs.filesystem.DirectoryNode;
import org.apache.poi.poifs.filesystem.NPOIFSFileSystem;
import org.apache.poi.poifs.filesystem.POIFSFileSystem; import org.apache.poi.poifs.filesystem.POIFSFileSystem;


/** /**
* @throws IOException * @throws IOException
*/ */
public MAPIMessage(POIFSFileSystem fs) throws IOException { public MAPIMessage(POIFSFileSystem fs) throws IOException {
this(fs.getRoot(), fs);
this(fs.getRoot());
}
/**
* Constructor for reading MSG Files from a POIFS filesystem
* @param fs
* @throws IOException
*/
public MAPIMessage(NPOIFSFileSystem fs) throws IOException {
this(fs.getRoot());
}
/**
* @deprecated Use {@link #MAPIMessage(DirectoryNode)} instead
*/
@Deprecated
public MAPIMessage(DirectoryNode poifsDir, POIFSFileSystem fs) throws IOException {
this(poifsDir);
} }
/** /**
* Constructor for reading MSG Files from a certain * Constructor for reading MSG Files from a certain
* @param fs * @param fs
* @throws IOException * @throws IOException
*/ */
public MAPIMessage(DirectoryNode poifsDir, POIFSFileSystem fs) throws IOException {
public MAPIMessage(DirectoryNode poifsDir) throws IOException {
super(poifsDir); super(poifsDir);


// Grab all the chunks // Grab all the chunks

+ 11
- 0
src/scratchpad/src/org/apache/poi/hsmf/extractor/OutlookTextExtactor.java View File

import org.apache.poi.hsmf.datatypes.AttachmentChunks; import org.apache.poi.hsmf.datatypes.AttachmentChunks;
import org.apache.poi.hsmf.exceptions.ChunkNotFoundException; import org.apache.poi.hsmf.exceptions.ChunkNotFoundException;
import org.apache.poi.poifs.filesystem.DirectoryNode; import org.apache.poi.poifs.filesystem.DirectoryNode;
import org.apache.poi.poifs.filesystem.NPOIFSFileSystem;
import org.apache.poi.poifs.filesystem.POIFSFileSystem; import org.apache.poi.poifs.filesystem.POIFSFileSystem;
import org.apache.poi.util.StringUtil.StringsIterator; import org.apache.poi.util.StringUtil.StringsIterator;


public OutlookTextExtactor(MAPIMessage msg) { public OutlookTextExtactor(MAPIMessage msg) {
super(msg); super(msg);
} }
/**
* Use {@link #OutlookTextExtactor(DirectoryNode)} instead
*/
@Deprecated
public OutlookTextExtactor(DirectoryNode poifsDir, POIFSFileSystem fs) throws IOException { public OutlookTextExtactor(DirectoryNode poifsDir, POIFSFileSystem fs) throws IOException {
this(new MAPIMessage(poifsDir, fs)); this(new MAPIMessage(poifsDir, fs));
} }
public OutlookTextExtactor(DirectoryNode poifsDir) throws IOException {
this(new MAPIMessage(poifsDir));
}
public OutlookTextExtactor(POIFSFileSystem fs) throws IOException { public OutlookTextExtactor(POIFSFileSystem fs) throws IOException {
this(new MAPIMessage(fs)); this(new MAPIMessage(fs));
} }
public OutlookTextExtactor(NPOIFSFileSystem fs) throws IOException {
this(new MAPIMessage(fs));
}
public OutlookTextExtactor(InputStream inp) throws IOException { public OutlookTextExtactor(InputStream inp) throws IOException {
this(new MAPIMessage(inp)); this(new MAPIMessage(inp));
} }

Loading…
Cancel
Save