package org.apache.poi.sl.usermodel;
import java.awt.Dimension;
+import java.io.Closeable;
import java.io.IOException;
import java.io.OutputStream;
import java.util.List;
public interface SlideShow<
S extends Shape<S,P>,
P extends TextParagraph<S,P,?>
-> {
+> extends Closeable {
Slide<S,P> createSlide() throws IOException;
List<? extends Slide<S,P>> getSlides();
import java.awt.Dimension;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
+import java.io.Closeable;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
* @author Nick Burch
* @author Yegor kozlov
*/
-public final class HSLFSlideShow implements SlideShow<HSLFShape,HSLFTextParagraph> {
+public final class HSLFSlideShow implements SlideShow<HSLFShape,HSLFTextParagraph>, Closeable {
// What we're based on
private HSLFSlideShowImpl _hslfSlideShow;
// TODO Auto-generated method stub
return null;
}
+
+ @Override
+ public void close() throws IOException {
+ _hslfSlideShow.close();
+ }
}
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
+import java.io.Closeable;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
*
* @author Nick Burch
*/
-public final class HSLFSlideShowImpl extends POIDocument {
+public final class HSLFSlideShowImpl extends POIDocument implements Closeable {
public static final int UNSET_OFFSET = -1;
// For logging
return _objects;
}
+ @Override
+ public void close() throws IOException {
+ NPOIFSFileSystem fs = directory.getFileSystem();
+ if (fs != null) {
+ fs.close();
+ }
+ }
+
private static class BufAccessBAOS extends ByteArrayOutputStream {
public byte[] getBuf() {