Changeset 28942
- Timestamp:
- 01/11/08 10:44:02 (11 months ago)
- Files:
-
- org.nuxeo.ecm.core/trunk/nuxeo-core-io/src/main/java/org/nuxeo/ecm/core/io/impl/AbstractDocumentReader.java (modified) (1 diff)
- org.nuxeo.ecm.core/trunk/nuxeo-core-io/src/main/java/org/nuxeo/ecm/core/io/impl/plugins/DocumentModelWriter.java (modified) (1 diff)
- org.nuxeo.ecm.core/trunk/nuxeo-core-io/src/main/java/org/nuxeo/ecm/core/io/impl/plugins/XMLDirectoryReader.java (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
org.nuxeo.ecm.core/trunk/nuxeo-core-io/src/main/java/org/nuxeo/ecm/core/io/impl/AbstractDocumentReader.java
r24938 r28942 44 44 break; 45 45 } 46 docs.add(doc); 46 47 /*NXP-1688 Rux: no ID, it should be a OS folder and not an exported one*/ 48 if (doc.getId() != null) 49 docs.add(doc); 47 50 } 48 51 if (docs.isEmpty()) { org.nuxeo.ecm.core/trunk/nuxeo-core-io/src/main/java/org/nuxeo/ecm/core/io/impl/plugins/DocumentModelWriter.java
r27340 r28942 87 87 Path targetPath) throws ClientException { 88 88 89 DocumentModel previousDoc; 89 DocumentModel previousDoc = null; 90 /*NXP-1688 Rux: if the document doesn't exist, the thrown ClientException is 91 * wrapped. Instead, an explicit query about the existence should do the job. 92 */ 93 PathRef pathRef = new PathRef(targetPath.toString()); 90 94 try { 91 previousDoc = session.getDocument(new PathRef(targetPath.toString())); 92 } catch (ClientException e) { 95 if (session.exists(pathRef)) 96 previousDoc = session.getDocument(pathRef); 97 } catch (ClientException ce) { 98 //don't care, document considered inexistent 93 99 previousDoc = null; 94 100 } 95 101 96 102 DocumentModel doc; 97 103 if (previousDoc == null) { org.nuxeo.ecm.core/trunk/nuxeo-core-io/src/main/java/org/nuxeo/ecm/core/io/impl/plugins/XMLDirectoryReader.java
r28190 r28942 31 31 import org.nuxeo.common.utils.FileTreeIterator; 32 32 import org.nuxeo.common.utils.FileUtils; 33 import org.nuxeo.common.utils.Path; 33 34 import org.nuxeo.ecm.core.api.impl.blob.StreamingBlob; 34 35 import org.nuxeo.ecm.core.io.api.ExportConstants; … … 91 92 Document doc = loadXML(file); 92 93 xdoc.setDocument(doc); 94 /*NXP-1688 Rux: the path was somehow left over when migrated from 95 core 1.3.4 to 1.4.0. Pull back.*/ 96 xdoc.setPath(computeRelativePath(dir)); 93 97 } else if (name.endsWith(".xml")) { 94 98 xdoc.putDocument( … … 106 110 } 107 111 112 /*NXP-1688 Rux: the path was somehow left over when migrated from 113 core 1.3.4 to 1.4.0. Pull back.*/ 114 private Path computeRelativePath(File file) { 115 return new Path( 116 file.getAbsolutePath().substring(source.getAbsolutePath().length())); 117 } 118 119 108 120 private static Document loadXML(File file) throws IOException { 109 121 BufferedInputStream in = null;
