diff options
author | Vincent Hennebert <vhennebert@apache.org> | 2007-05-29 07:51:52 +0000 |
---|---|---|
committer | Vincent Hennebert <vhennebert@apache.org> | 2007-05-29 07:51:52 +0000 |
commit | 300ac95fdc1729f14ae40c5dfe78d9f8a332bece (patch) | |
tree | ca4c07d3cf827d4597a6095594dcbb3a824c7e54 /src/java/org/apache/fop/util | |
parent | a5107a6f25b440686ac839611d7ff52c7b5f2dd8 (diff) | |
download | xmlgraphics-fop-300ac95fdc1729f14ae40c5dfe78d9f8a332bece.tar.gz xmlgraphics-fop-300ac95fdc1729f14ae40c5dfe78d9f8a332bece.zip |
Bug #42476:
- fix NPE in XMLReader when no handler is found for the image
- prevent SVGReader from closing the input stream if the image actually isn't SVG
- reduce log level in SVGReader and XMLReader to avoid "false positive" (read error reported whereas the image format actually isn't recognized). This may hide regular I/O errors to the end-user, but I assume this will be rare enough compared to the annoyance of such messages when third-party plugins are used.
Patch submitted by Max Berger (max.at.berger.name)
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@542447 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache/fop/util')
-rw-r--r-- | src/java/org/apache/fop/util/UnclosableInputStream.java | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/src/java/org/apache/fop/util/UnclosableInputStream.java b/src/java/org/apache/fop/util/UnclosableInputStream.java new file mode 100644 index 000000000..0384a62ff --- /dev/null +++ b/src/java/org/apache/fop/util/UnclosableInputStream.java @@ -0,0 +1,46 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* $Id$ */ + +package org.apache.fop.util; + +import java.io.FilterInputStream; +import java.io.InputStream; + +/** + * Provides an InputStreamFilter which avoids closing the original stream. + */ +public class UnclosableInputStream extends FilterInputStream { + + /** + * Default constructor. + * + * @param in the Stream to filter. + */ + public UnclosableInputStream(InputStream in) { + super(in); + } + + /** + * Does <strong>not</strong> close the original stream. + */ + public void close() { + // ignore + } + +} |