}
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;
}