Index: C:/Development/Projekte/JackRabbit/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/server/io/DefaultHandler.java =================================================================== --- C:/Development/Projekte/JackRabbit/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/server/io/DefaultHandler.java (revision 619439) +++ C:/Development/Projekte/JackRabbit/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/server/io/DefaultHandler.java (working copy) @@ -290,6 +290,7 @@ if (isCollection) { contentNode = parentNode; } else { + String orgMimeType = null; if (parentNode.hasNode(JcrConstants.JCR_CONTENT)) { contentNode = parentNode.getNode(JcrConstants.JCR_CONTENT); // check if nodetype is compatible (might be update of an existing file) @@ -303,12 +304,19 @@ } } } else { + //if we find a mimetype, set it again on the created content node see http://issues.apache.org/jira/browse/JCR-1393 + if (contentNode.hasProperty(JcrConstants.JCR_MIMETYPE)) { + orgMimeType = contentNode.getProperty(JcrConstants.JCR_MIMETYPE).getString(); + } contentNode.remove(); contentNode = null; } } if (contentNode == null) { contentNode = parentNode.addNode(JcrConstants.JCR_CONTENT, getContentNodeType()); + if (orgMimeType != null) { + contentNode.setProperty(JcrConstants.JCR_MIMETYPE, orgMimeType); + } } } return contentNode;