Indexer.java revision 439
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* See LICENSE.txt included in this distribution for the specific
* language governing permissions and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at LICENSE.txt.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2007 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/**
* Creates and updates an inverted source index
* as well as generates Xref, file stats etc., if specified
* in the options
*/
public final class Indexer {
public static Indexer getInstance() {
return index;
}
/**
* Program entry point
* @param argv argument vector
*/
boolean runIndex = true;
boolean update = true;
boolean optimizedChanged = false;
} else {
boolean searchRepositories = false;
boolean addProjects = false;
boolean refreshHistory = false;
boolean listFiles = false;
boolean createDict = false;
// Parse command line options:
try {
} catch (ParseException ex) {
}
try{
int cmd;
// We need to read the configuration file first, since we
// will try to overwrite options..
if (cmd == 'R') {
break;
}
}
// Now we can handle all the other options..
switch (cmd) {
case 't':
createDict = true;
runIndex = false;
break;
case 'P': addProjects = true; break;
case 'w': {
}
} else {
}
}
break;
case 'R':
// already handled
break;
case 'n': runIndex = false; break;
case 'H': refreshHistory = true; break;
case 'r': {
env.setRemoteScmSupported(true);
env.setRemoteScmSupported(false);
} else {
}
}
break;
case 'O': {
env.setOptimizeDatabase(true);
env.setOptimizeDatabase(false);
} else {
}
optimizedChanged = true;
}
}
break;
case 's': {
if (!file.isDirectory()) {
}
break;
}
case 'd':
break;
case 'i':
break;
case 'S' : searchRepositories = true; break;
case 'Q' :
env.setQuickContextScan(true);
env.setQuickContextScan(false);
} else {
System.err.println(" Ex: \"-Q on\" will just scan a \"chunk\" of the file and insert \"[..all..]\"");
System.err.println(" \"-Q off\" will try to build a more accurate list by reading the complete file.");
}
break;
case 'm' : {
try {
} catch (NumberFormatException exp) {
}
break;
}
case 'a' :
env.setAllowLeadingWildcard(true);
env.setAllowLeadingWildcard(false);
} else {
}
break;
case 'A': {
}
break;
}
try {
arg[0],
} catch (Exception e) {
" as a FileAnalyzerFactory");
e.printStackTrace();
}
}
break;
case 'L' :
break;
case 'T' :
try {
} catch (NumberFormatException exp) {
}
break;
case 'l' :
env.setUsingLuceneLocking(true);
env.setUsingLuceneLocking(false);
} else {
}
break;
case '?':
break;
default:
}
}
if (optind != -1) {
++optind;
}
}
progress);
}
} catch (IndexerException ex) {
} catch (IOException ioe) {
}
}
}
boolean searchRepositories,
boolean addProjects,
boolean refreshHistory,
boolean listFiles,
boolean createDict,
throw new IndexerException("ERROR: Please specify a DATA ROOT path");
}
try {
} catch (IOException e) {
}
}
throw new IndexerException("ERROR: please specify a SRC_ROOT with option -s !");
}
}
}
if (!env.validateExuberantCtags()) {
throw new IndexerException("Didn't find Exuberant Ctags");
}
if (searchRepositories) {
}
}
}
if (addProjects) {
}
}
// The projects should be sorted...
int ret;
} else {
}
return ret;
}
});
}
if (defaultProject != null) {
env.setDefaultProject(p);
break;
}
}
}
if (configFilename != null) {
}
}
}
if (refreshHistory) {
}
if (listFiles) {
}
if (createDict) {
}
}
throws IOException {
if (update) {
} else if (env.isOptimizeDatabase()) {
}
} else {
} else {
} else {
db = new IndexDatabase();
}
if (idx != -1) {
}
if (idx == -1) {
}
} else {
}
}
}
public void run() {
try {
if (update) {
} else if (optimize) {
}
} catch (Exception e) {
e.printStackTrace();
}
}
});
}
}
while (!executor.isTerminated()) {
try {
} catch (Exception e) {
}
}
}
if (configHost != null) {
}
try {
+ configHost,ex);
}
} else {
}
}
}
}
}
private Indexer() {
}
}