Package org.tmatesoft.svn.core.internal.util

Examples of org.tmatesoft.svn.core.internal.util.CountingInputStream


            }
            return -1;
        }

        if (mySAXParser == null) {
            CountingInputStream stream = null;
            try {
                mySAXParser = getSAXParserFactory().newSAXParser();
                if (myRequest.getContentLength() > 0) {
                    org.xml.sax.XMLReader reader = mySAXParser.getXMLReader();
                    reader.setContentHandler(this);
                    reader.setDTDHandler(this);
                    reader.setErrorHandler(this);
                    reader.setEntityResolver(this);
                    stream = new CountingInputStream(getRequestInputStream());
                    XMLReader xmlReader = new XMLReader(stream);
                    reader.parse(new InputSource(xmlReader));
                }
            } catch (ParserConfigurationException e) {
                if (stream == null || stream.getBytesRead() > 0) {
                    SVNErrorManager.error(SVNErrorMessage.create(SVNErrorCode.RA_DAV_REQUEST_FAILED, e), e, SVNLogType.NETWORK);
                }
            } catch (SAXException e) {
                if (stream == null || stream.getBytesRead() > 0) {
                    SVNErrorManager.error(SVNErrorMessage.create(SVNErrorCode.RA_DAV_REQUEST_FAILED, e), e, SVNLogType.NETWORK);
                }
            } catch (IOException e) {
                if (stream == null || stream.getBytesRead() > 0) {
                    SVNErrorManager.error(SVNErrorMessage.create(SVNErrorCode.RA_DAV_REQUEST_FAILED, e), e, SVNLogType.NETWORK);
                }
            }

            if (stream != null) {
                if (stream.getBytesRead() > 0) {
                    getDAVRequest().init();
                }
                return stream.getBytesRead();
            }
        }
       
        return 0;
    }
View Full Code Here

TOP

Related Classes of org.tmatesoft.svn.core.internal.util.CountingInputStream

Copyright © 2018 www.massapicom. 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.