Skip to content

Commit

Permalink
Suppressing built-in jcr:mimeType
Browse files Browse the repository at this point in the history
  • Loading branch information
escowles committed Jul 16, 2015
1 parent 3b6464d commit 25d54b0
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
Expand Up @@ -643,6 +643,9 @@ public void testPatchBinaryNameAndType() throws Exception {
HAS_MIME_TYPE.asNode(), createLiteral("text/plain")));
assertTrue(graphStore.contains(ANY, createURI(serverAddress + pid + "/x"),
HAS_ORIGINAL_NAME.asNode(), createLiteral("x.txt")));
assertFalse("Should not contain old mime type property",
graphStore.contains(ANY, createURI(serverAddress + pid + "/x"),
createURI(REPOSITORY_NAMESPACE + "mimeType"), ANY));
}

@Test
Expand Down
Expand Up @@ -115,7 +115,24 @@ public boolean apply(final Property p) {
@Override
public boolean apply(final Property p) {
return JcrPropertyFunctions.isBinaryContentProperty.apply(p)
|| isProtectedAndShouldBeHidden.apply(p);
|| isProtectedAndShouldBeHidden.apply(p)
|| isSuppressedProperty.apply(p);
}
};

/**
* Check if a property is a reference property.
*/
public static Predicate<Property> isSuppressedProperty =
new Predicate<Property>() {

@Override
public boolean apply(final Property p) {
try {
return p.getName().equals("jcr:mimeType");
} catch (final RepositoryException e) {
throw new RepositoryRuntimeException(e);
}
}
};

Expand Down

0 comments on commit 25d54b0

Please sign in to comment.