Skip to content

Commit

Permalink
More whitespace and static import cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
ajs6f committed Oct 21, 2013
1 parent 16634cd commit bf562ae
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 15 deletions.
25 changes: 12 additions & 13 deletions fcrepo-kernel/src/main/java/org/fcrepo/kernel/Datastream.java
Expand Up @@ -97,11 +97,11 @@ private void mixinTypeSpecificCrap() {
node.addMixin(FEDORA_DATASTREAM);

if (node.hasNode(JCR_CONTENT)) {
Node contentNode = node.getNode(JCR_CONTENT);
final Node contentNode = node.getNode(JCR_CONTENT);
decorateContentNode(contentNode);
}
}
} catch (RepositoryException ex) {
} catch (final RepositoryException ex) {
LOGGER.warn("Could not decorate {} with {} properties: {}" ,
JCR_CONTENT, FEDORA_DATASTREAM, ex);
}
Expand All @@ -124,8 +124,7 @@ public InputStream getContent() throws RepositoryException {
* @throws RepositoryException
*/
public void setContent(final InputStream content, final String contentType,
final URI checksum,
StoragePolicyDecisionPoint storagePolicyDecisionPoint)
final URI checksum, final StoragePolicyDecisionPoint storagePolicyDecisionPoint)
throws RepositoryException, InvalidChecksumException {

final Node contentNode =
Expand All @@ -149,7 +148,7 @@ public void setContent(final InputStream content, final String contentType,
hint = storagePolicyDecisionPoint.evaluatePolicies(node);
}

Binary binary = (Binary) getBinary(node, content, hint);
final Binary binary = (Binary) getBinary(node, content, hint);

/*
* This next line of code deserves explanation. If we chose for the
Expand Down Expand Up @@ -189,7 +188,7 @@ public void setContent(final InputStream content, final String contentType,
* @throws InvalidChecksumException
* @throws RepositoryException
*/
public void setContent(InputStream content) throws InvalidChecksumException,
public void setContent(final InputStream content) throws InvalidChecksumException,
RepositoryException {
setContent(content, null, null, null);
}
Expand All @@ -202,7 +201,7 @@ public long getContentSize() {
try {
return node.getNode(JCR_CONTENT).getProperty(CONTENT_SIZE)
.getLong();
} catch (RepositoryException e) {
} catch (final RepositoryException e) {
LOGGER.error("Could not get contentSize() - " + e.getMessage());
}
// TODO Size is not stored, recalculate size?
Expand All @@ -218,16 +217,16 @@ public URI getContentDigest() throws RepositoryException {
final Node contentNode = node.getNode(JCR_CONTENT);
try {
return new URI(contentNode.getProperty(CONTENT_DIGEST).getString());
} catch (RepositoryException e) {
} catch (final RepositoryException e) {
LOGGER.error("Could not get content digest: ", e);
} catch (URISyntaxException e) {
} catch (final URISyntaxException e) {
LOGGER.error("Could not get content digest: {}", e);
}
//TODO checksum not stored. recalculating checksum,
//however, this would defeat the purpose validating against the checksum
Binary binary = (Binary) contentNode.getProperty(JCR_DATA)
final Binary binary = (Binary) contentNode.getProperty(JCR_DATA)
.getBinary();
String dsChecksum = binary.getHexHash();
final String dsChecksum = binary.getHexHash();

return ContentDigest.asURI("SHA-1",dsChecksum);
}
Expand Down Expand Up @@ -271,7 +270,7 @@ public long getSize() throws RepositoryException {

}

private void decorateContentNode(Node contentNode)
private void decorateContentNode(final Node contentNode)
throws RepositoryException {
if (contentNode == null) {
LOGGER.warn("{}/{} appears to be null!", JCR_CONTENT);
Expand All @@ -282,7 +281,7 @@ private void decorateContentNode(Node contentNode)
}

final Property dataProperty = contentNode.getProperty(JCR_DATA);
Binary binary = (Binary) dataProperty.getBinary();
final Binary binary = (Binary) dataProperty.getBinary();
final String dsChecksum = binary.getHexHash();

contentSizeHistogram.update(dataProperty.getLength());
Expand Down
Expand Up @@ -17,6 +17,7 @@
package org.fcrepo.kernel.rdf;

import static com.hp.hpl.jena.graph.NodeFactory.createURI;
import static com.hp.hpl.jena.rdf.model.ModelFactory.createDefaultModel;
import static org.slf4j.LoggerFactory.getLogger;

import java.util.Iterator;
Expand All @@ -26,7 +27,6 @@
import com.hp.hpl.jena.graph.Node;
import com.hp.hpl.jena.query.Dataset;
import com.hp.hpl.jena.rdf.model.Model;
import com.hp.hpl.jena.rdf.model.ModelFactory;
import com.hp.hpl.jena.sparql.util.Context;
import com.hp.hpl.jena.sparql.util.Symbol;

Expand Down Expand Up @@ -84,7 +84,7 @@ public static Node getDatasetSubject(final Dataset rdf) {
*/
public static Model unifyDatasetModel(final Dataset dataset) {
final Iterator<String> iterator = dataset.listNames();
Model model = ModelFactory.createDefaultModel();
Model model = createDefaultModel();

model = model.union(dataset.getDefaultModel());

Expand Down

0 comments on commit bf562ae

Please sign in to comment.