use of org.apache.jackrabbit.commons.xml.ToXmlContentHandler in project jackrabbit-oak by apache.
the class SessionImpl method exportSystemView.
@Override
public void exportSystemView(String absPath, OutputStream out, boolean skipBinary, boolean noRecurse) throws IOException, RepositoryException {
try {
ContentHandler handler = new ToXmlContentHandler(checkNotNull(out));
export(checkNotNull(absPath), new SystemViewExporter(this, handler, !noRecurse, !skipBinary));
} catch (SAXException e) {
Exception exception = e.getException();
if (exception instanceof RepositoryException) {
throw (RepositoryException) exception;
} else if (exception instanceof IOException) {
throw (IOException) exception;
} else {
throw new RepositoryException("Error serializing system view XML", e);
}
}
}
use of org.apache.jackrabbit.commons.xml.ToXmlContentHandler in project jackrabbit-oak by apache.
the class SessionImpl method exportDocumentView.
@Override
public void exportDocumentView(String absPath, OutputStream out, boolean skipBinary, boolean noRecurse) throws IOException, RepositoryException {
try {
ContentHandler handler = new ToXmlContentHandler(checkNotNull(out));
export(checkNotNull(absPath), new DocumentViewExporter(this, handler, !noRecurse, !skipBinary));
} catch (SAXException e) {
Exception exception = e.getException();
if (exception instanceof RepositoryException) {
throw (RepositoryException) exception;
} else if (exception instanceof IOException) {
throw (IOException) exception;
} else {
throw new RepositoryException("Error serializing document view XML", e);
}
}
}
use of org.apache.jackrabbit.commons.xml.ToXmlContentHandler in project jackrabbit by apache.
the class AbstractSession method exportDocumentView.
/**
* Calls {@link Session#exportDocumentView(String, ContentHandler, boolean, boolean)}
* with the given arguments and a {@link ContentHandler} that serializes
* SAX events to the given output stream.
*
* @param absPath passed through
* @param out output stream to which the SAX events are serialized
* @param skipBinary passed through
* @param noRecurse passed through
* @throws IOException if the SAX serialization failed
* @throws RepositoryException if another error occurs
*/
public void exportDocumentView(String absPath, OutputStream out, boolean skipBinary, boolean noRecurse) throws IOException, RepositoryException {
try {
ContentHandler handler = new ToXmlContentHandler(out);
exportDocumentView(absPath, handler, skipBinary, noRecurse);
} catch (SAXException e) {
Exception exception = e.getException();
if (exception instanceof RepositoryException) {
throw (RepositoryException) exception;
} else if (exception instanceof IOException) {
throw (IOException) exception;
} else {
throw new RepositoryException("Error serializing document view XML", e);
}
}
}
use of org.apache.jackrabbit.commons.xml.ToXmlContentHandler in project jackrabbit by apache.
the class AbstractSession method exportSystemView.
/**
* Calls {@link Session#exportSystemView(String, ContentHandler, boolean, boolean)}
* with the given arguments and a {@link ContentHandler} that serializes
* SAX events to the given output stream.
*
* @param absPath passed through
* @param out output stream to which the SAX events are serialized
* @param skipBinary passed through
* @param noRecurse passed through
* @throws IOException if the SAX serialization failed
* @throws RepositoryException if another error occurs
*/
public void exportSystemView(String absPath, OutputStream out, boolean skipBinary, boolean noRecurse) throws IOException, RepositoryException {
try {
ContentHandler handler = new ToXmlContentHandler(out);
exportSystemView(absPath, handler, skipBinary, noRecurse);
} catch (SAXException e) {
Exception exception = e.getException();
if (exception instanceof RepositoryException) {
throw (RepositoryException) exception;
} else if (exception instanceof IOException) {
throw (IOException) exception;
} else {
throw new RepositoryException("Error serializing system view XML", e);
}
}
}
Aggregations