diff options
author | PJ Fanning <fanningpj@apache.org> | 2021-12-18 17:41:36 +0000 |
---|---|---|
committer | PJ Fanning <fanningpj@apache.org> | 2021-12-18 17:41:36 +0000 |
commit | f4bb4560edd288e6916d222b76caa8c9aa97baf7 (patch) | |
tree | 32cd4d321b2c012418e2a8658c43d16d0958ec8a /poi-scratchpad/src | |
parent | 53c88399f645f60aa27c3600b7d4419c4425a98d (diff) | |
download | poi-f4bb4560edd288e6916d222b76caa8c9aa97baf7.tar.gz poi-f4bb4560edd288e6916d222b76caa8c9aa97baf7.zip |
code tidy up
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1896139 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'poi-scratchpad/src')
6 files changed, 50 insertions, 7 deletions
diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hmef/HMEFMessage.java b/poi-scratchpad/src/main/java/org/apache/poi/hmef/HMEFMessage.java index 6997cbf87b..f6e3b6c801 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hmef/HMEFMessage.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hmef/HMEFMessage.java @@ -47,7 +47,13 @@ public final class HMEFMessage { private final List<TNEFAttribute> messageAttributes = new ArrayList<>(); private final List<MAPIAttribute> mapiAttributes = new ArrayList<>(); private final List<Attachment> attachments = new ArrayList<>(); - + + /** + * @param inp input stream + * @throws IOException + * @throws RuntimeException a number of runtime exceptions can be thrown, especially if there are problems with the + * input format + */ public HMEFMessage(InputStream inp) throws IOException { try { // Check the signature matches diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hslf/usermodel/HSLFSlideShow.java b/poi-scratchpad/src/main/java/org/apache/poi/hslf/usermodel/HSLFSlideShow.java index f7c7d4fa7e..736aae9d58 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hslf/usermodel/HSLFSlideShow.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hslf/usermodel/HSLFSlideShow.java @@ -166,6 +166,9 @@ public final class HSLFSlideShow extends POIDocument implements SlideShow<HSLFSh /** * Constructs a Powerpoint document from an input stream. + * @throws IOException + * @throws RuntimeException a number of runtime exceptions can be thrown, especially if there are problems with the + * input format */ @SuppressWarnings("resource") public HSLFSlideShow(InputStream inputStream) throws IOException { @@ -174,6 +177,9 @@ public final class HSLFSlideShow extends POIDocument implements SlideShow<HSLFSh /** * Constructs a Powerpoint document from an POIFSFileSystem. + * @throws IOException + * @throws RuntimeException a number of runtime exceptions can be thrown, especially if there are problems with the + * input format */ @SuppressWarnings("resource") public HSLFSlideShow(POIFSFileSystem poifs) throws IOException { @@ -182,6 +188,9 @@ public final class HSLFSlideShow extends POIDocument implements SlideShow<HSLFSh /** * Constructs a Powerpoint document from an DirectoryNode. + * @throws IOException + * @throws RuntimeException a number of runtime exceptions can be thrown, especially if there are problems with the + * input format */ @SuppressWarnings("resource") public HSLFSlideShow(DirectoryNode root) throws IOException { diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hsmf/MAPIMessage.java b/poi-scratchpad/src/main/java/org/apache/poi/hsmf/MAPIMessage.java index f13d397705..6965aef448 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hsmf/MAPIMessage.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hsmf/MAPIMessage.java @@ -103,7 +103,9 @@ public class MAPIMessage extends POIReadOnlyDocument { * Constructor for reading MSG Files from the file system. * * @param filename Name of the file to read - * @exception IOException on errors reading, or invalid data + * @throws IOException on errors reading, or invalid data + * @throws RuntimeException a number of runtime exceptions can be thrown, especially if there are problems with the + * input format */ public MAPIMessage(String filename) throws IOException { this(new File(filename)); @@ -112,7 +114,9 @@ public class MAPIMessage extends POIReadOnlyDocument { * Constructor for reading MSG Files from the file system. * * @param file The file to read from - * @exception IOException on errors reading, or invalid data + * @throws IOException on errors reading, or invalid data + * @throws RuntimeException a number of runtime exceptions can be thrown, especially if there are problems with the + * input format */ public MAPIMessage(File file) throws IOException { this(new POIFSFileSystem(file)); @@ -124,8 +128,10 @@ public class MAPIMessage extends POIReadOnlyDocument { * <p>Note - this will buffer the whole message into memory * in order to process. For lower memory use, use {@link #MAPIMessage(File)} * - * @param in The InputStream to buffer then read from - * @exception IOException on errors reading, or invalid data + * @param in The InputStream to buffer and then read from + * @throws IOException on errors reading, or invalid data + * @throws RuntimeException a number of runtime exceptions can be thrown, especially if there are problems with the + * input format */ public MAPIMessage(InputStream in) throws IOException { this(new POIFSFileSystem(in)); @@ -134,7 +140,9 @@ public class MAPIMessage extends POIReadOnlyDocument { * Constructor for reading MSG Files from a POIFS filesystem * * @param fs Open POIFS FileSystem containing the message - * @exception IOException on errors reading, or invalid data + * @throws IOException on errors reading, or invalid data + * @throws RuntimeException a number of runtime exceptions can be thrown, especially if there are problems with the + * input format */ public MAPIMessage(POIFSFileSystem fs) throws IOException { this(fs.getRoot()); @@ -143,7 +151,9 @@ public class MAPIMessage extends POIReadOnlyDocument { * Constructor for reading MSG Files from a certain * point within a POIFS filesystem * @param poifsDir Directory containing the message - * @exception IOException on errors reading, or invalid data + * @throws IOException on errors reading, or invalid data + * @throws RuntimeException a number of runtime exceptions can be thrown, especially if there are problems with the + * input format */ public MAPIMessage(DirectoryNode poifsDir) throws IOException { super(poifsDir); diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hssf/converter/ExcelToHtmlConverter.java b/poi-scratchpad/src/main/java/org/apache/poi/hssf/converter/ExcelToHtmlConverter.java index 7c0fd29801..36e8b5983e 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hssf/converter/ExcelToHtmlConverter.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hssf/converter/ExcelToHtmlConverter.java @@ -104,6 +104,8 @@ public class ExcelToHtmlConverter extends AbstractExcelConverter { * @return DOM representation of result HTML * @throws IOException If an error occurs reading or writing files * @throws ParserConfigurationException If configuration is incorrect + * @throws RuntimeException a number of runtime exceptions can be thrown, especially if there are problems with the + * input format */ public static Document process(File xlsFile) throws IOException, ParserConfigurationException { try (HSSFWorkbook workbook = loadXls(xlsFile)) { @@ -118,6 +120,8 @@ public class ExcelToHtmlConverter extends AbstractExcelConverter { * @return DOM representation of result HTML * @throws IOException If an error occurs reading or writing files * @throws ParserConfigurationException If configuration is incorrect + * @throws RuntimeException a number of runtime exceptions can be thrown, especially if there are problems with the + * input format */ public static Document process(InputStream xlsStream) throws IOException, ParserConfigurationException { try (HSSFWorkbook workbook = new HSSFWorkbook(xlsStream)) { @@ -132,6 +136,8 @@ public class ExcelToHtmlConverter extends AbstractExcelConverter { * @return DOM representation of result HTML * @throws IOException If an error occurs reading or writing files * @throws ParserConfigurationException If configuration is incorrect + * @throws RuntimeException a number of runtime exceptions can be thrown, especially if there are problems with the + * input format */ public static Document process(HSSFWorkbook workbook) throws IOException, ParserConfigurationException { ExcelToHtmlConverter excelToHtmlConverter = new ExcelToHtmlConverter( diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hwmf/usermodel/HwmfPicture.java b/poi-scratchpad/src/main/java/org/apache/poi/hwmf/usermodel/HwmfPicture.java index 640212a382..ac57804945 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hwmf/usermodel/HwmfPicture.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hwmf/usermodel/HwmfPicture.java @@ -80,6 +80,12 @@ public class HwmfPicture implements Iterable<HwmfRecord>, GenericRecord { return MAX_RECORD_LENGTH; } + /** + * @param inputStream + * @throws IOException + * @throws RuntimeException a number of runtime exceptions can be thrown, especially if there are problems with the + * input format + */ public HwmfPicture(InputStream inputStream) throws IOException { try (LittleEndianInputStream leis = new LittleEndianInputStream(inputStream)) { diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/HWPFDocument.java b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/HWPFDocument.java index f31df61f38..a058881977 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/HWPFDocument.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/HWPFDocument.java @@ -215,6 +215,8 @@ public final class HWPFDocument extends HWPFDocumentCore { * @throws IOException If there is an unexpected IOException from the passed * in InputStream. * @throws org.apache.poi.EmptyFileException If the given stream is empty + * @throws RuntimeException a number of other runtime exceptions can be thrown, especially if there are problems with the + * input format */ public HWPFDocument(InputStream istream) throws IOException { //do Ole stuff @@ -227,6 +229,8 @@ public final class HWPFDocument extends HWPFDocumentCore { * @param pfilesystem The POIFSFileSystem that contains the Word document. * @throws IOException If there is an unexpected IOException from the passed * in POIFSFileSystem. + * @throws RuntimeException a number of runtime exceptions can be thrown, especially if there are problems with the + * input format */ public HWPFDocument(POIFSFileSystem pfilesystem) throws IOException { this(pfilesystem.getRoot()); @@ -240,6 +244,8 @@ public final class HWPFDocument extends HWPFDocumentCore { * @param directory The DirectoryNode that contains the Word document. * @throws IOException If there is an unexpected IOException from the passed * in POIFSFileSystem. + * @throws RuntimeException a number of runtime exceptions can be thrown, especially if there are problems with the + * input format */ public HWPFDocument(DirectoryNode directory) throws IOException { // Load the main stream and FIB |