}
/**
- * @param stream
+ * @param stream The InputStream to read from
* @param closeStream whether to close the stream (default is false)
* @since POI 5.2.0
* @return OPCPackage
- * @throws IOException
+ * @throws IOException If reading data from the stream fails
*/
public static OPCPackage open(InputStream stream, boolean closeStream) throws IOException {
try {
/**
* @param is InputStream
- * @throws IOException
+ * @throws IOException If reading data from the stream fails
* @throws POIXMLException a RuntimeException that can be caused by invalid OOXML data
* @throws RuntimeException a number of other runtime exceptions can be thrown, especially if there are problems with the
* input format
/**
* Controls whether {@link #getSharedStringsTable()} uses {@link SharedStringsTable}
* or {@link ReadOnlySharedStringsTable}.
- * @param useReadOnlySharedStringsTable
+ *
+ * @param useReadOnlySharedStringsTable if true, the ReadOnlySharedStringsTable is used,
+ * SharedStringsTable otherwise
* @since POI 5.2.0
*/
public void setUseReadOnlySharedStringsTable(boolean useReadOnlySharedStringsTable) {
* footprint than an InputStream backed one.
*
* @param pkg the OpenXML4J {@code OPC Package} object.
- * @throws IOException
+ * @throws IOException If reading data from the package fails
* @throws POIXMLException a RuntimeException that can be caused by invalid OOXML data
* @throws RuntimeException a number of other runtime exceptions can be thrown, especially if there are problems with the
* input format
* pkg.close(); // gracefully closes the underlying zip file
* }</pre>
*
- * @throws IOException
+ * @throws IOException If reading data from the stream fails
* @throws POIXMLException a RuntimeException that can be caused by invalid OOXML data
* @throws RuntimeException a number of other runtime exceptions can be thrown, especially if there are problems with the
* input format
* than opening from an InputStream
*
* @param file the file to open
- * @throws IOException
- * @throws InvalidFormatException
+ * @throws IOException If reading data from the file fails
+ * @throws InvalidFormatException If the file has a format that cannot be read or if the file is corrupted
* @throws POIXMLException a RuntimeException that can be caused by invalid OOXML data
* @throws RuntimeException a number of other runtime exceptions can be thrown, especially if there are problems with the
* input format
* than opening from an InputStream
*
* @param path the file name.
- * @throws IOException
+ * @throws IOException If reading data from the file fails
* @throws POIXMLException a RuntimeException that can be caused by invalid OOXML data
* @throws RuntimeException a number of other runtime exceptions can be thrown, especially if there are problems with the
* input format
/**
* Constructs a XSSFWorkbook object using Package Part.
* @param part package part
- * @throws IOException
+ * @throws IOException If reading data from the Package Part fails
* @throws POIXMLException a RuntimeException that can be caused by invalid OOXML data
* @throws RuntimeException a number of other runtime exceptions can be thrown, especially if there are problems with the
* input format
/**
* @param pkg OPC package
- * @throws IOException
+ * @throws IOException If reading data from the package fails
* @throws POIXMLException a RuntimeException that can be caused by invalid OOXML data
* @throws RuntimeException a number of other runtime exceptions can be thrown, especially if there are problems with the
* input format
}
/**
- * @param is InputStream
- * @throws IOException
+ * @param is The InputStream to read data from
+ * @throws IOException If reading data from the stream fails
* @throws POIXMLException a RuntimeException that can be caused by invalid OOXML data
* @throws RuntimeException a number of other runtime exceptions can be thrown, especially if there are problems with the
* input format
}
/**
- * @param ctx
- * @param graphicsBounds
+ * @param ctx The Graphics-context to draw on
+ * @param graphicsBounds A rectangle which describes the bounds
+ * for drawing
* @throws IllegalStateException if the draw fails
*/
public void draw(Graphics2D ctx, Rectangle2D graphicsBounds) {
*/
public final class HMEFMessage {
public static final int HEADER_SIGNATURE = 0x223e9f78;
-
+
@SuppressWarnings("unused")
private int fileId;
private final List<TNEFAttribute> messageAttributes = new ArrayList<>();
/**
* @param inp input stream
- * @throws IOException
+ * @throws IOException If reading data from the stream fails
* @throws RuntimeException a number of runtime exceptions can be thrown, especially if there are problems with the
* input format
*/
"expected " + HEADER_SIGNATURE + " but got " + sig
);
}
-
+
// Read the File ID
fileId = LittleEndian.readUShort(inp);
-
+
// Now begin processing the contents
process(inp);
} finally {
inp.close();
}
}
-
+
private void process(InputStream inp) throws IOException {
int level;
do {
Attachment attach = attachments.get(attachments.size() - 1);
attach.addAttribute(attr);
}
-
+
/**
- * Returns all HMEF/TNEF attributes of the message.
+ * Returns all HMEF/TNEF attributes of the message.
* Note - In a typical message, most of the interesting properties
- * are stored as {@link MAPIAttribute}s - see {@link #getMessageMAPIAttributes()}
+ * are stored as {@link MAPIAttribute}s - see {@link #getMessageMAPIAttributes()}
*/
public List<TNEFAttribute> getMessageAttributes() {
return Collections.unmodifiableList(messageAttributes);
}
-
+
/**
* Returns all MAPI attributes of the message.
* Note - A small number of HMEF/TNEF specific attributes normally
public List<MAPIAttribute> getMessageMAPIAttributes() {
return Collections.unmodifiableList(mapiAttributes);
}
-
+
/**
* Returns all the Attachments of the message.
*/
public List<Attachment> getAttachments() {
return Collections.unmodifiableList(attachments);
}
-
+
/**
* Return the message attribute with the given ID,
- * or null if there isn't one.
+ * or null if there isn't one.
*/
public TNEFAttribute getMessageAttribute(TNEFProperty id) {
for (TNEFAttribute attr : messageAttributes) {
}
return null;
}
-
+
/**
* Return the message MAPI Attribute with the given ID,
- * or null if there isn't one.
+ * or null if there isn't one.
*/
public MAPIAttribute getMessageMAPIAttribute(MAPIProperty id) {
for (MAPIAttribute attr : mapiAttributes) {
}
return null;
}
-
+
/**
* Return the string value of the mapi property, or null
* if it isn't set
private String getString(MAPIProperty id) {
return MAPIStringAttribute.getAsString( getMessageMAPIAttribute(id) );
}
-
+
/**
* Returns the Message Subject, or null if the mapi property
* for this isn't set
public String getSubject() {
return getString(MAPIProperty.CONVERSATION_TOPIC);
}
-
+
/**
* Returns the Message Body, as RTF, or null if the mapi property
* for this isn't set
public abstract class Bitmap extends HSLFPictureData {
/**
- * @deprecated Use {@link HSLFSlideShow#addPicture(byte[], PictureType)} or one of its overloads to create new
+ * @deprecated Use {@link HSLFSlideShow#addPicture(byte[], org.apache.poi.sl.usermodel.PictureData.PictureType)} or one of its overloads to create new
* {@link Bitmap}. This API led to detached {@link Bitmap} instances (See Bugzilla
* 46122) and prevented adding additional functionality.
*/
private static final int HEADER_SIZE = 14;
/**
- * @deprecated Use {@link HSLFSlideShow#addPicture(byte[], PictureType)} or one of its overloads to create new
+ * @deprecated Use {@link HSLFSlideShow#addPicture(byte[], org.apache.poi.sl.usermodel.PictureData.PictureType)} or one of its overloads to create new
* {@link DIB}. This API led to detached {@link DIB} instances (See Bugzilla
* 46122) and prevented adding additional functionality.
*/
public final class EMF extends Metafile {
/**
- * @deprecated Use {@link HSLFSlideShow#addPicture(byte[], PictureType)} or one of its overloads to create new
+ * @deprecated Use {@link HSLFSlideShow#addPicture(byte[], org.apache.poi.sl.usermodel.PictureData.PictureType)} or one of its overloads to create new
* EMF. This API led to detached EMF instances (See Bugzilla
* 46122) and prevented adding additional functionality.
*/
private ColorSpace colorSpace = ColorSpace.rgb;
/**
- * @deprecated Use {@link HSLFSlideShow#addPicture(byte[], PictureType)} or one of its overloads to create new
+ * @deprecated Use {@link HSLFSlideShow#addPicture(byte[], org.apache.poi.sl.usermodel.PictureData.PictureType)} or one of its overloads to create new
* {@link JPEG}. This API led to detached {@link JPEG} instances (See Bugzilla
* 46122) and prevented adding additional functionality.
*/
public JPEG(EscherContainerRecord recordContainer, EscherBSERecord bse) {
super(recordContainer, bse);
}
-
+
@Override
public PictureType getType(){
return PictureType.JPEG;
public ColorSpace getColorSpace() {
return colorSpace;
}
-
+
public void setColorSpace(ColorSpace colorSpace) {
this.colorSpace = colorSpace;
}
-
+
/**
- * JPEG signature is one of {@code 0x46A0, 0x46B0, 0x6E20, 0x6E30}
+ * JPEG signature is one of {@code 0x46A0, 0x46B0, 0x6E20, 0x6E30}
*
* @return JPEG signature ({@code 0x46A0, 0x46B0, 0x6E20, 0x6E30})
*/
? (getUIDInstanceCount() == 1 ? 0x46A0 : 0x46B0)
: (getUIDInstanceCount() == 1 ? 0x6E20 : 0x6E30);
}
-
+
/**
* Sets the PICT signature - either {@code 0x5420} or {@code 0x5430}
*/
break;
default:
throw new IllegalArgumentException(signature+" is not a valid instance/signature value for JPEG");
- }
+ }
}
}
private static final Logger LOG = LogManager.getLogger(PICT.class);
/**
- * @deprecated Use {@link HSLFSlideShow#addPicture(byte[], PictureType)} or one of its overloads to create new
+ * @deprecated Use {@link HSLFSlideShow#addPicture(byte[], org.apache.poi.sl.usermodel.PictureData.PictureType)} or one of its overloads to create new
* PICT. This API led to detached PICT instances (See Bugzilla
* 46122) and prevented adding additional functionality.
*/
public final class PNG extends Bitmap {
/**
- * @deprecated Use {@link HSLFSlideShow#addPicture(byte[], PictureType)} or one of its overloads to create new
+ * @deprecated Use {@link HSLFSlideShow#addPicture(byte[], org.apache.poi.sl.usermodel.PictureData.PictureType)} or one of its overloads to create new
* {@link PNG}. This API led to detached {@link PNG} instances (See Bugzilla
* 46122) and prevented adding additional functionality.
*/
public int getSignature(){
return (getUIDInstanceCount() == 1 ? 0x6E00 : 0x6E10);
}
-
+
/**
* Sets the PNG signature - either {@code 0x6E00} or {@code 0x6E10}
*/
break;
default:
throw new IllegalArgumentException(signature+" is not a valid instance/signature value for PNG");
- }
+ }
}
}
public final class WMF extends Metafile {
/**
- * @deprecated Use {@link HSLFSlideShow#addPicture(byte[], PictureType)} or one of its overloads to create new
+ * @deprecated Use {@link HSLFSlideShow#addPicture(byte[], org.apache.poi.sl.usermodel.PictureData.PictureType)} or one of its overloads to create new
* WMF. This API led to detached WMF instances (See Bugzilla
* 46122) and prevented adding additional functionality.
*/
final EscherBSERecord bse;
/**
- * @deprecated Use {@link HSLFSlideShow#addPicture(byte[], PictureType)} or one of its overloads to create new
+ * @deprecated Use {@link HSLFSlideShow#addPicture(byte[], org.apache.poi.sl.usermodel.PictureData.PictureType)} or one of its overloads to create new
* {@link HSLFPictureData}. This API led to detached {@link HSLFPictureData} instances (See Bugzilla
* 46122) and prevented adding additional functionality.
*/
*
* @param type type of picture.
* @return concrete instance of {@link HSLFPictureData}.
- * @deprecated Use {@link HSLFSlideShow#addPicture(byte[], PictureType)} or one of its overloads to create new
+ * @deprecated Use {@link HSLFSlideShow#addPicture(byte[], org.apache.poi.sl.usermodel.PictureData.PictureType)} or one of its overloads to create new
* {@link HSLFPictureData}. This API led to detached {@link HSLFPictureData} instances (See Bugzilla
* 46122) and prevented adding additional functionality.
*/
/**
* Constructs a Powerpoint document from an input stream.
- * @throws IOException
+ * @throws IOException If reading data from the stream fails
* @throws RuntimeException a number of runtime exceptions can be thrown, especially if there are problems with the
* input format
*/
/**
* Constructs a Powerpoint document from an POIFSFileSystem.
- * @throws IOException
+ * @throws IOException If reading data from the file-system fails
* @throws RuntimeException a number of runtime exceptions can be thrown, especially if there are problems with the
* input format
*/
/**
* Constructs a Powerpoint document from an DirectoryNode.
- * @throws IOException
+ * @throws IOException If reading data from the DirectoryNode fails
* @throws RuntimeException a number of runtime exceptions can be thrown, especially if there are problems with the
* input format
*/
}
/**
- * @param inputStream
- * @throws IOException
+ * @param inputStream The InputStream to read data from
+ * @throws IOException If reading data from the file fails
* @throws RuntimeException a number of runtime exceptions can be thrown, especially if there are problems with the
* input format
*/
*
* @param channel the FileChannel from which to read the data
* @throws IOException on errors reading, or on invalid data
- * @see POIFSFileSystem(FileChannel, boolean, boolean) this constructor gives more control over whether to
+ * @see #POIFSFileSystem(FileChannel, boolean, boolean) this constructor gives more control over whether to
* close the provided channel
*/
public POIFSFileSystem(FileChannel channel)
* @param channel the FileChannel from which to read or read/write the data
* @param readOnly whether the POIFileSystem will only be used in read-only mode
* @throws IOException on errors reading, or on invalid data
- * @see POIFSFileSystem(FileChannel, boolean, boolean) this constructor gives more control over whether to
+ * @see #POIFSFileSystem(FileChannel, boolean, boolean) this constructor gives more control over whether to
* close the provided channel
*/
public POIFSFileSystem(FileChannel channel, boolean readOnly)