Skip to content
This repository has been archived by the owner on Jan 3, 2019. It is now read-only.

Commit

Permalink
Address checkstyle issues in preparation for tighter enforcement
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Woods committed May 21, 2014
1 parent f89a841 commit a8ccb20
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
Expand Up @@ -139,8 +139,8 @@ protected static DefaultHttpClient createHttpClient(final String repositoryURL,
if (!isBlank(fedoraUsername) && !isBlank(fedoraPassword)) {
LOGGER.debug("Adding BASIC credentials to client for repo requests.");

URI fedoraUri = URI.create(repositoryURL);
CredentialsProvider credsProvider = new BasicCredentialsProvider();
final URI fedoraUri = URI.create(repositoryURL);
final CredentialsProvider credsProvider = new BasicCredentialsProvider();
credsProvider.setCredentials(new AuthScope(fedoraUri.getHost(), fedoraUri.getPort()),
new UsernamePasswordCredentials(fedoraUsername, fedoraPassword));

Expand Down Expand Up @@ -305,12 +305,12 @@ public void reindex() {
* @param uri The resource URI to reindex.
* @param recursive If true, also recursively reindex all children.
**/
public void reindex( final String uri, boolean recursive ) {
public void reindex( final String uri, final boolean recursive ) {
reindexed = new HashSet<>();
reindexURI( uri, recursive );
}

private void reindexURI( final String uri, boolean recursive ) {
private void reindexURI( final String uri, final boolean recursive ) {
LOGGER.debug("Reindexing {}, recursive: {}", uri, recursive);
if ( !reindexed.contains(uri) ) {
// index() will check for indexable mixin
Expand All @@ -325,7 +325,7 @@ private void reindexURI( final String uri, boolean recursive ) {
final Supplier<Model> rdfr
= memoize(new RdfRetriever(uri, httpClient));
final Model model = rdfr.get();
NodeIterator children = model.listObjectsOfProperty( HAS_CHILD );
final NodeIterator children = model.listObjectsOfProperty( HAS_CHILD );
while ( children.hasNext() ) {
final String child = children.nextNode().asResource().getURI();
if ( !reindexed.contains(child) ) {
Expand Down
Expand Up @@ -254,7 +254,7 @@ public ListeningExecutorService executorService() {
/**
* Note: Protected for Unit Tests to overwrite.
*/
protected QueryEngineHTTP buildQueryEngineHTTP(String describeQuery) {
protected QueryEngineHTTP buildQueryEngineHTTP(final String describeQuery) {
return new QueryEngineHTTP( queryBase, describeQuery );
}

Expand Down
Expand Up @@ -44,26 +44,26 @@ public class FedoraIndexer extends HttpServlet {
/**
* Servlet initialization.
**/
public void init( ServletConfig sc ) throws ServletException {
public void init( final ServletConfig sc ) throws ServletException {
super.init(sc);
WebApplicationContext ctx
final WebApplicationContext ctx
= WebApplicationContextUtils.getRequiredWebApplicationContext(getServletContext());
indexer = (IndexerGroup)ctx.getBean( sc.getInitParameter("beanName") );
}

/**
* Trigger reindexing.
**/
public void doPost(HttpServletRequest request, HttpServletResponse response)
public void doPost(final HttpServletRequest request, final HttpServletResponse response)
throws ServletException {
String recurParam = request.getParameter("recursive");
boolean recursive = (recurParam == null || recurParam.equals("true"));
String path = request.getPathInfo();
final String recurParam = request.getParameter("recursive");
final boolean recursive = (recurParam == null || recurParam.equals("true"));
final String path = request.getPathInfo();
indexer.reindex( indexer.getRepositoryURL() + path, recursive );

try {
response.setContentType("text/plain");
PrintWriter out = response.getWriter();
final PrintWriter out = response.getWriter();
out.println("Reindexing started");
} catch ( Exception ex ) {
LOGGER.warn("Error sending output");
Expand Down

0 comments on commit a8ccb20

Please sign in to comment.