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 bf562ae commit 06682db
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
Expand Up @@ -16,6 +16,7 @@
package org.fcrepo.kernel.utils;

import static com.google.common.base.Throwables.propagate;
import static java.util.Collections.singletonMap;
import static org.apache.commons.codec.binary.Hex.encodeHexString;
import static org.slf4j.LoggerFactory.getLogger;

Expand All @@ -41,7 +42,7 @@ public abstract class ContentDigest {
.of("SHA-1", "urn:sha1", "SHA1", "urn:sha1");

public static final Map<String, String> schemeToAlgorithm =
ImmutableMap.of("urn:sha1", "SHA-1");
singletonMap("urn:sha1", "SHA-1");

/**
* Convert a MessageDigest algorithm and checksum value to a URN
Expand Down Expand Up @@ -76,7 +77,7 @@ public static URI asURI(final String algorithm, final byte[] data) {
* @param digestUri
* @return
*/
public static String getAlgorithm(URI digestUri) {
public static String getAlgorithm(final URI digestUri) {
return schemeToAlgorithm
.get(digestUri.getScheme() + ":" +
digestUri.getSchemeSpecificPart().split(":", 2)[0]);
Expand Down
Expand Up @@ -22,6 +22,8 @@
import static com.google.common.collect.ImmutableSet.copyOf;
import static com.hp.hpl.jena.rdf.model.ResourceFactory.createProperty;
import static javax.jcr.query.Query.JCR_SQL2;
import static org.fcrepo.jcr.FedoraJcrTypes.CONTENT_SIZE;
import static org.fcrepo.jcr.FedoraJcrTypes.FEDORA_BINARY;
import static org.fcrepo.jcr.FedoraJcrTypes.FEDORA_DATASTREAM;
import static org.fcrepo.jcr.FedoraJcrTypes.FEDORA_OBJECT;
import static org.fcrepo.jcr.FedoraJcrTypes.FEDORA_RESOURCE;
Expand Down Expand Up @@ -422,15 +424,15 @@ public static long getRepositorySize(final Repository repository)
session.getWorkspace().getQueryManager();

final String querystring =
"SELECT [" + FedoraJcrTypes.CONTENT_SIZE + "] FROM [" +
FedoraJcrTypes.FEDORA_BINARY + "]";
"SELECT [" + CONTENT_SIZE + "] FROM [" +
FEDORA_BINARY + "]";

final QueryResult queryResults =
queryManager.createQuery(querystring, JCR_SQL2).execute();

for (final RowIterator rows = queryResults.getRows(); rows.hasNext();) {
final Value value =
rows.nextRow().getValue(FedoraJcrTypes.CONTENT_SIZE);
rows.nextRow().getValue(CONTENT_SIZE);
sum += value.getLong();
}

Expand Down

1 comment on commit 06682db

@awoods
Copy link

@awoods awoods commented on 06682db Oct 21, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you going to be chipping away at this? or shall I go ahead and merge it in?

Please sign in to comment.