Changeset 30001
- Timestamp:
- 02/11/08 11:10:10 (10 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
org.nuxeo.ecm.core/trunk/nuxeo-core-io/src/main/java/org/nuxeo/ecm/core/io/IODocumentManager.java
r29017 r30001 32 32 33 33 /** 34 * 35 * @author dm 34 * Defines functional interface that deals directly with documents import using 35 * provided DocumentReader or InputStream as a source and DocumentWriter that 36 * knows how the documents will be saved into the repository. 37 * 38 * @author <a href="mailto:dm@nuxeo.com">Dragos Mihalache</a> 36 39 */ 37 40 public interface IODocumentManager extends Serializable { … … 42 45 43 46 DocumentTranslationMap importDocuments(InputStream in, 47 DocumentWriter customDocWriter) throws ImportDocumentException, 48 ClientException, IOException; 49 50 /** 51 * 52 * @param customDocReader reader from the input stream 53 * @param customDocWriter 54 * @return 55 * @throws ImportDocumentException 56 * @throws ClientException 57 * @throws IOException 58 */ 59 DocumentTranslationMap importDocuments(DocumentReader customDocReader, 44 60 DocumentWriter customDocWriter) throws ImportDocumentException, 45 61 ClientException, IOException; org.nuxeo.ecm.core/trunk/nuxeo-core-io/src/main/java/org/nuxeo/ecm/core/io/impl/IODocumentManagerImpl.java
r29017 r30001 221 221 } 222 222 223 public DocumentTranslationMap importDocuments( 224 DocumentReader customDocReader, DocumentWriter customDocWriter) 225 throws ImportDocumentException, ClientException, IOException { 226 227 try { 228 DocumentPipe pipe = new DocumentPipeImpl(10); 229 pipe.setReader(customDocReader); 230 pipe.setWriter(customDocWriter); 231 DocumentTranslationMap map = pipe.run(); 232 233 // will need to save session before notifying events, otherwise docs 234 // won't be found 235 // writer.close(); 236 237 return map; 238 } catch (Exception e) { 239 throw new ImportDocumentException(e); 240 } 241 } 242 223 243 }
