001/*
002 * Copyright (c) 2006-2011 Nuxeo SA (http://nuxeo.com/) and others.
003 *
004 * All rights reserved. This program and the accompanying materials
005 * are made available under the terms of the Eclipse Public License v1.0
006 * which accompanies this distribution, and is available at
007 * http://www.eclipse.org/legal/epl-v10.html
008 *
009 * Contributors:
010 *     bstefanescu
011 *
012 * $Id: DocumentModelReader.java 29029 2008-01-14 18:38:14Z ldoguin $
013 */
014
015package org.nuxeo.ecm.core.io.impl.plugins;
016
017import java.io.IOException;
018
019import org.nuxeo.ecm.core.api.CoreSession;
020import org.nuxeo.ecm.core.io.ExportedDocument;
021import org.nuxeo.ecm.core.io.impl.AbstractDocumentReader;
022
023/**
024 * @author <a href="mailto:bs@nuxeo.com">Bogdan Stefanescu</a>
025 */
026public abstract class DocumentModelReader extends AbstractDocumentReader {
027
028    protected CoreSession session;
029
030    protected boolean inlineBlobs = false;
031
032    protected DocumentModelReader(CoreSession session) {
033        this.session = session;
034    }
035
036    @Override
037    public abstract ExportedDocument read() throws IOException;
038
039    @Override
040    public void close() {
041        session = null;
042    }
043
044    /**
045     * @param inlineBlobs the inlineBlobs to set.
046     */
047    public void setInlineBlobs(boolean inlineBlobs) {
048        this.inlineBlobs = inlineBlobs;
049    }
050
051    public boolean getInlineBlobs() {
052        return inlineBlobs;
053    }
054
055}