Indexer.java revision 1463
0N/A * The contents of this file are subject to the terms of the 0N/A * Common Development and Distribution License (the "License"). 0N/A * You may not use this file except in compliance with the License. 0N/A * language governing permissions and limitations under the License. 0N/A * When distributing Covered Code, include this CDDL HEADER in each 0N/A * If applicable, add the following below this CDDL HEADER, with the 0N/A * fields enclosed by brackets "[]" replaced with your own identifying 0N/A * information: Portions Copyright [yyyy] [name of copyright owner] 1393N/A * Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved. 1185N/A * Portions Copyright 2011 Jens Elkner. 0N/A * Creates and updates an inverted source index 0N/A * as well as generates Xref, file stats etc., if specified 886N/A "org.apache.derby.jdbc.EmbeddedDriver";
886N/A "org.apache.derby.jdbc.ClientDriver";
1463N/A * Get the indexer instance. 65N/A * Program entry point 65N/A * @param argv argument vector 77N/A // Parse command line options: 111N/A // We need to read the configuration file first, since we 111N/A // will try to overwrite options.. 111N/A // Now we can handle all the other options.. 886N/A // Should be a full class name, but we also accept 886N/A // the shorthands "client" and "embedded". Expand 886N/A // the shorthands here. 1416N/A +
"' not found for the -o option");
491N/A System.
err.
println(
" \"-Q off\" will try to build a more accurate list by reading the complete file.");
886N/A // The default database driver is Derby's client driver. 886N/A // The default URL depends on the database driver. 1017N/A // automatically allow symlinks that are directly in source root 1088N/A //Set updated configuration in RuntimeEnvironment 1093N/A // PMD wants us to use length() > 0 && charAt(0) instead of startsWith() 1093N/A // for performance. We prefer clarity over performance here, so silence it. 1463N/A * Prepare the environment to execute indexing. Basically it does some 1463N/A * consistency checks wrt. commadline options sets and executes simple tasks 1463N/A * like zapping or refreshing the history cache, list available projects 1463N/A * including their path, create spelling index for related projects, 1463N/A * @param searchRepositories If {@code true} scan for new repositories in 1463N/A * the source root directory. 1463N/A * @param addProjects If {@code true} add automatically projects found 1463N/A * @param defaultProject The name of the project to use as default. Might 1463N/A * @param configFilename The pathname of the configuration file to write. 1463N/A * If {@code null} writing the config file gets skipped. 1463N/A * for the given or all projects. 1463N/A * @param listFiles If {@code true}, print a list of all files of 1463N/A * the index database for given projects to stdout. 1463N/A * @param listTokens If {@code true}, print a list of frequent 1463N/A * tokens for related projects to stdout. 1463N/A * @param subFiles Determine target projects by the given repo 1463N/A * files when <var>listFiles</var> or <var>createDict</var> is set to 1463N/A * {@code true}. {@code null} implies "all projects". 1463N/A * @param repositories Target repositories.{@code null} implies 1463N/A * @param zapCache List of project names, whose history cache should 1463N/A * be zapped. An Asterisk ('*') implies zap all. Ignored if empty. 1463N/A * @param listRepoPathes If {@code true}, just list available projects 1463N/A * incl. their path, zap projects (if set) and return. 1463N/A * @throws NullPointerException if <var>env</var> or <var>zapCache</var> is 1092N/A // Keep a copy of the old project list so that we can preserve 1092N/A // the customization of existing projects. 1092N/A // Add a project for each top-level directory in source root. 1092N/A // This is an existing object. Reuse the old project, 1092N/A // possibly with customizations, instead of creating a 1092N/A // new with default values. 1092N/A // Found a new directory with no matching project, so 1092N/A // create a new project with default properties. 491N/A // The projects should be sorted... 1463N/A * Index and optionally optimize related databases. Obtains an 1463N/A * {@link RuntimeEnvironment} instance and registers with it, so that 1463N/A * required infos are obtained from there. 1463N/A * @param update If {@code true} update the index for related projects. 1463N/A * @param noThreads Number of threads to use for indexing. 1463N/A * @param subFiles Use the giben repo files to determine the projects, 1463N/A * which should be indexed or index db optimized. 1463N/A * @param progress If {@code true} show progress when indexing. Wrt. 1463N/A * to logging and terminal flooding a really bad idea. 1463N/A * @see IndexDatabase#update(ExecutorService, IndexChangedListener, List) 1463N/A * Send the configuration of the current thread's runtime environment to 1463N/A * @param configHost where to send the configuration. Format: host:port . 1327N/A +
" (is web application server running with opengrok deployed?): "