Examples of CloseShieldInputStream


Examples of org.apache.commons.io.input.CloseShieldInputStream

                        String name = entry.getName();
                        int pos = name.lastIndexOf('/');
                        if ( pos != -1 ) {
                            creator.switchCurrentNode(name.substring(0, pos), NT_FOLDER);
                        }
                        creator.createFileAndResourceNode(name, new CloseShieldInputStream(zis), null, entry.getTime());
                        creator.finishNode();
                        creator.finishNode();
                        if ( pos != -1 ) {
                            creator.finishNode();
                        }
View Full Code Here

Examples of org.apache.commons.io.input.CloseShieldInputStream

                        String name = entry.getName();
                        int pos = name.lastIndexOf('/');
                        if ( pos != -1 ) {
                            creator.switchCurrentNode(name.substring(0, pos), NT_FOLDER);
                        }
                        creator.createFileAndResourceNode(name, new CloseShieldInputStream(zis), null, entry.getTime());
                        creator.finishNode();
                        creator.finishNode();
                        if ( pos != -1 ) {
                            creator.finishNode();
                        }
View Full Code Here

Examples of org.apache.commons.io.input.CloseShieldInputStream

                }
                String path = zipFile.getPath() + ":" + name;
                name = name.substring((Constants.META_DIR + "/").length());
                if (name.equals(Constants.FILTER_XML)) {
                    // load filter
                    inf.loadFilter(new CloseShieldInputStream(zin), path);
                } else if (name.equals(Constants.CONFIG_XML)) {
                    // load config
                    inf.loadConfig(new CloseShieldInputStream(zin), path);
                } else if (name.equals(Constants.SETTINGS_XML)) {
                    // load settings
                    inf.loadSettings(new CloseShieldInputStream(zin), path);
                } else if (name.equals(Constants.PROPERTIES_XML)) {
                    // load properties
                    inf.loadProperties(new CloseShieldInputStream(zin), path);
                } else if (name.equals(Constants.PRIVILEGES_XML)) {
                    // load privileges
                    inf.loadPrivileges(new CloseShieldInputStream(zin), path);
                } else if (name.equals(Constants.PACKAGE_DEFINITION_XML)) {
                    inf.setHasDefinition(true);
                    log.debug("Contains package definition {}.", path);
                } else if (name.endsWith(".cnd")) {
                    try {
                        Reader r = new InputStreamReader(new CloseShieldInputStream(zin), "utf8");
                        CNDReader reader = ServiceProviderFactory.getProvider().getCNDReader();
                        reader.read(r, entry.getName(), null);
                        inf.getNodeTypes().add(reader);
                        log.debug("Loaded nodetypes from {}.", path);
                    } catch (IOException e1) {
View Full Code Here

Examples of org.apache.commons.io.input.CloseShieldInputStream

        in = new PipedInputStream(out, 8192);

        pumpThread = new Thread(new Runnable() {
            public void run() {
                try {
                    pump.run(new CloseShieldInputStream(in));
                    // ensure that input stream is pumping in case it didn't read to the end
                    byte[] buffer = new byte[8192];
                    while (in.read(buffer) >= 0);
                } catch (Exception e) {
                    error = e;
View Full Code Here

Examples of org.apache.commons.io.input.CloseShieldInputStream

        FilterInputStreamCache cache = null;

        try {
           
            //first, get the content of the request
            is = new CloseShieldInputStream(request.getInputStream());

            if(is.available() <= 0) {
                return null;
            }
           
View Full Code Here

Examples of org.apache.tika.io.CloseShieldInputStream

                Iterator<ImageReader> iterator =
                    ImageIO.getImageReadersByMIMEType(type);
                if (iterator.hasNext()) {
                    ImageReader reader = iterator.next();
                    reader.setInput(ImageIO.createImageInputStream(
                            new CloseShieldInputStream(stream)));
                    metadata.set("height", Integer.toString(reader.getHeight(0)));
                    metadata.set("width", Integer.toString(reader.getWidth(0)));
                    reader.dispose();
                }
            } catch (IIOException e) {
View Full Code Here

Examples of org.apache.tika.io.CloseShieldInputStream

            stream = new BufferedInputStream(stream);
        }

        // Protect the stream from being closed by CyberNeko
        // TODO: Is this still needed, given our use of TagSoup?
        stream = new CloseShieldInputStream(stream);

        // Prepare the input source using the encoding hint if available
        InputSource source = new InputSource(stream);
        source.setEncoding(getEncoding(stream, metadata));
View Full Code Here

Examples of org.apache.tika.io.CloseShieldInputStream

                // the exception is fine here, deployments without this feature
                // are inherently vulnerable to XML denial-of-service attacks.
            }
            SAXParser parser = factory.newSAXParser();
            parser.parse(
                    new CloseShieldInputStream(stream),
                    new OfflineContentHandler(xhtml));
        } catch (ParserConfigurationException e) {
            throw new TikaException("XML parser configuration error", e);
        }
    }
View Full Code Here

Examples of org.apache.tika.io.CloseShieldInputStream

                // the exception is fine here, deployments without this feature
                // are inherently vulnerable to XML denial-of-service attacks.
            }
            SAXParser parser = factory.newSAXParser();
            parser.parse(
                    new CloseShieldInputStream(stream),
                    new OfflineContentHandler(
                            new NSNormalizerContentHandler(dh)));
        } catch (ParserConfigurationException e) {
            throw new TikaException("XML parser configuration error", e);
        }
View Full Code Here

Examples of org.apache.tika.io.CloseShieldInputStream

                Iterator<ImageReader> iterator =
                    ImageIO.getImageReadersByMIMEType(type);
                if (iterator.hasNext()) {
                    ImageReader reader = iterator.next();
                    reader.setInput(ImageIO.createImageInputStream(
                            new CloseShieldInputStream(stream)));
                    metadata.set("height", Integer.toString(reader.getHeight(0)));
                    metadata.set("width", Integer.toString(reader.getWidth(0)));
                    reader.dispose();
                }
            } catch (IIOException e) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.