Skip to content

Commit

Permalink
Non-functional commit: Reformat based on 120 character limit
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Woods committed Nov 7, 2013
1 parent 3901662 commit 0df86ab
Show file tree
Hide file tree
Showing 9 changed files with 56 additions and 21 deletions.
24 changes: 17 additions & 7 deletions fcrepo-http-api/src/main/java/org/fcrepo/http/api/FedoraNodes.java
Expand Up @@ -181,16 +181,20 @@ public Dataset describe(@PathParam("path") final List<PathSegment> pathList,
final Dataset propertiesDataset =
resource.getPropertiesDataset(subjects, offset, realLimit);

final Model treeModel = propertiesDataset.getNamedModel(propertiesDataset.getContext().getAsString(INLINED_RESOURCES_MODEL, "NO SUCH MODEL"));
final Model treeModel = propertiesDataset.getNamedModel(
propertiesDataset.getContext()
.getAsString(INLINED_RESOURCES_MODEL,
"NO SUCH MODEL"));
if (limit > 0 && treeModel != null && treeModel
.contains(subjects.getGraphSubject(resource.getNode()),
HAS_CHILD_COUNT)) {

final Model requestModel = createDefaultModel();

final long childCount = treeModel
.listObjectsOfProperty(subjects.getGraphSubject(resource.getNode()), HAS_CHILD_COUNT)
.nextNode().asLiteral().getLong();
.listObjectsOfProperty(subjects.getGraphSubject(resource.getNode()),
HAS_CHILD_COUNT)
.nextNode().asLiteral().getLong();

if (childCount > (offset + limit)) {

Expand Down Expand Up @@ -462,7 +466,8 @@ public Response createObject(@PathParam("path")
result = datastreamService.createDatastream(session, newObjectPath);
break;
default:
throw new WebApplicationException(clientError().entity("Unknown object type " + objectType).build());
throw new WebApplicationException(clientError().entity(
"Unknown object type " + objectType).build());
}

if (requestBodyStream != null) {
Expand All @@ -480,7 +485,8 @@ public Response createObject(@PathParam("path")
final Lang lang = contentTypeToLang(contentTypeString);

if (lang == null) {
throw new WebApplicationException(notAcceptable().entity("Invalid Content type " + contentType).build());
throw new WebApplicationException(notAcceptable().entity(
"Invalid Content type " + contentType).build());
}

final String format = lang.getName()
Expand Down Expand Up @@ -599,7 +605,9 @@ public Response copyObject(@PathParam("path") final List<PathSegment> path,
} catch (final ItemExistsException e) {
return status(SC_PRECONDITION_FAILED).entity("Destination resource already exists").build();
} catch (final PathNotFoundException e) {
return status(SC_CONFLICT).entity("There is no node that will serve as the parent of the moved item").build();
return status(SC_CONFLICT).entity(
"There is no node that will serve as the parent of the moved item")
.build();
} finally {
session.logout();
}
Expand Down Expand Up @@ -637,7 +645,9 @@ public Response moveObject(@PathParam("path") final List<PathSegment> path,
} catch (final ItemExistsException e) {
return status(SC_PRECONDITION_FAILED).entity("Destination resource already exists").build();
} catch (final PathNotFoundException e) {
return status(SC_CONFLICT).entity("There is no node that will serve as the parent of the moved item").build();
return status(SC_CONFLICT).entity(
"There is no node that will serve as the parent of the moved item")
.build();
} finally {
session.logout();
}
Expand Down
Expand Up @@ -73,7 +73,9 @@ public class HierarchyRdfContext extends NodeRdfContext {
* @throws RepositoryException
*/
public HierarchyRdfContext(final javax.jcr.Node node,
final GraphSubjects graphSubjects, final LowLevelStorageService lowLevelStorageService) throws RepositoryException {
final GraphSubjects graphSubjects,
final LowLevelStorageService lowLevelStorageService)
throws RepositoryException {
super(node, graphSubjects, lowLevelStorageService);
if (node.getDepth() > 0) {
LOGGER.debug("Determined that this node has a parent.");
Expand Down
Expand Up @@ -71,7 +71,9 @@ public Iterator<Triple> apply(final T input) {
try {
final Node propertyDefinitionNode = getResource(input).asNode();

LOGGER.trace("Adding triples for nodeType: {} with child nodes: {}", context.getURI(), propertyDefinitionNode.getURI());
LOGGER.trace("Adding triples for nodeType: {} with child nodes: {}",
context.getURI(),
propertyDefinitionNode.getURI());

return new RdfStream(
create(propertyDefinitionNode, type.asNode(), Property.asNode()),
Expand Down
Expand Up @@ -59,9 +59,13 @@ public Iterator<Triple> apply(final NodeDefinition input) {

if (requiredPrimaryTypes.length > 1) {
// TODO we can express this as an OWL unionOf. But should we?
LOGGER.trace("Skipping RDFS:range for {} with multiple primary types", propertyDefinitionNode.getName());
LOGGER.trace(
"Skipping RDFS:range for {} with multiple primary types",
propertyDefinitionNode.getName());
} else if (requiredPrimaryTypes.length == 1) {
LOGGER.trace("Adding RDFS:range for {} with primary types {}", input.getName(), requiredPrimaryTypes[0].getName());
LOGGER.trace("Adding RDFS:range for {} with primary types {}",
input.getName(),
requiredPrimaryTypes[0].getName());
final Triple nsTriple =
create(propertyDefinitionNode, range.asNode(), getResource(
requiredPrimaryTypes[0]).asNode());
Expand Down
Expand Up @@ -343,8 +343,11 @@ public RdfStream getNodeTypes(final Session session) throws RepositoryException
* @throws RepositoryException
* @throws IOException
*/
public void registerNodeTypes(final Session session, final InputStream cndStream) throws RepositoryException, IOException {
final NodeTypeManager nodeTypeManager = (NodeTypeManager) session.getWorkspace().getNodeTypeManager();
public void registerNodeTypes(final Session session,
final InputStream cndStream)
throws RepositoryException, IOException {
final NodeTypeManager nodeTypeManager = (NodeTypeManager) session.getWorkspace()
.getNodeTypeManager();
nodeTypeManager.registerNodeTypes(cndStream, true);
}
}
Expand Up @@ -135,7 +135,10 @@ public void addedStatement(final Statement s) {

// extract the JCR propertyName from the predicate
final String propertyName =
jcrRdfTools.getPropertyNameFromPredicate(subjectNode, s.getPredicate(), s.getModel().getNsPrefixMap());
jcrRdfTools.getPropertyNameFromPredicate(subjectNode,
s.getPredicate(),
s.getModel()
.getNsPrefixMap());

if (validateModificationsForPropertyName(
subject, subjectNode, s.getPredicate())) {
Expand Down Expand Up @@ -188,7 +191,12 @@ public void removedStatement(final Statement s) {
try {
subjectNode.removeMixin(mixinName);
} catch (final RepositoryException e) {
LOGGER.info("problem with removing <{}> <{}> <{}>: {}", subject.getURI(), RdfLexicon.COULD_NOT_STORE_PROPERTY, s.getPredicate().getURI(), e);
LOGGER.info(
"problem with removing <{}> <{}> <{}>: {}",
subject.getURI(),
RdfLexicon.COULD_NOT_STORE_PROPERTY,
s.getPredicate().getURI(),
e);
problems.add(subject, RdfLexicon.COULD_NOT_STORE_PROPERTY, s.getPredicate().getURI());
}
return;
Expand Down Expand Up @@ -226,7 +234,10 @@ public void removedStatement(final Statement s) {
private boolean validateModificationsForPropertyName(
final Resource subject, final Node subjectNode, final Resource predicate) {
if (jcrRdfTools.isInternalProperty(subjectNode, predicate)) {
LOGGER.debug("problem with <{}> <{}> <{}>", subject.getURI(), RdfLexicon.COULD_NOT_STORE_PROPERTY, predicate.getURI());
LOGGER.debug("problem with <{}> <{}> <{}>",
subject.getURI(),
RdfLexicon.COULD_NOT_STORE_PROPERTY,
predicate.getURI());
problems.add(subject, RdfLexicon.COULD_NOT_STORE_PROPERTY, predicate.getURI());
return false;
}
Expand Down
Expand Up @@ -50,7 +50,7 @@ public StoragePolicyDecisionPointImpl() {

/*
* (non-Javadoc)
* @see org.fcrepo.kernel.services.policy.StoragePolicyDecisionPoint#addPolicy(org.fcrepo.kernel.services.policy.StoragePolicy)
* @see org.fcrepo.kernel.services.policy.StoragePolicyDecisionPoint#addPolicy(StoragePolicy)
*/
@Override
public void addPolicy(final org.fcrepo.kernel.services.policy.StoragePolicy p) {
Expand All @@ -74,7 +74,7 @@ public String evaluatePolicies(final Node n) {

/*
* (non-Javadoc)
* @see org.fcrepo.kernel.services.policy.StoragePolicyDecisionPoint#addPolicy(org.fcrepo.kernel.services.policy.StoragePolicy)
* @see org.fcrepo.kernel.services.policy.StoragePolicyDecisionPoint#addPolicy(StoragePolicy)
*/
@Override
public void removePolicy(final StoragePolicy p) {
Expand All @@ -83,7 +83,7 @@ public void removePolicy(final StoragePolicy p) {

/*
* (non-Javadoc)
* @see org.fcrepo.kernel.services.policy.StoragePolicyDecisionPoint#addPolicy(org.fcrepo.kernel.services.policy.StoragePolicy)
* @see org.fcrepo.kernel.services.policy.StoragePolicyDecisionPoint#addPolicy(StoragePolicy)
*/
@Override
public void removeAll() {
Expand Down
Expand Up @@ -69,7 +69,10 @@ public Transformation getTransform(final MediaType contentType,
if (Transformation.class.isAssignableFrom(transform)) {
try {
return (Transformation)(transform.getConstructor(InputStream.class).newInstance(inputStream));
} catch (NoSuchMethodException | InvocationTargetException | InstantiationException | IllegalAccessException e) {
} catch (NoSuchMethodException
| InvocationTargetException
| InstantiationException
| IllegalAccessException e) {
propagate(e);
}
}
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Expand Up @@ -21,7 +21,7 @@
<!-- Dependency version properties -->
<activemq.version>5.9.0</activemq.version>
<enunciate.version>1.27</enunciate.version>
<fcrepo-build-tools.version>1.3</fcrepo-build-tools.version>
<fcrepo-build-tools.version>1.4-SNAPSHOT</fcrepo-build-tools.version>
<httpcomponents.version>4.3</httpcomponents.version>
<httpclient.version>4.3.1</httpclient.version>
<infinispan.version>5.3.0.Final</infinispan.version>
Expand Down

0 comments on commit 0df86ab

Please sign in to comment.