Indexer.java revision 11
/*
* 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 2005 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/*
* ident "%Z%%M% %I% %E% SMI"
*/
//import org.apache.lucene.search.spell.*;
/**
* Creates and updates an inverted source index
* as well as generates Xref, file stats etc., if specified
* in the options
*/
public class Indexer {
private static boolean verbose = true;
private static boolean economical = false;
"opengrok.jar [-qe] [-c ctagsToUse] [-w webapproot] [-i ignore_name [ -i ..]] [-m directory [-m ...]] [-s SRC_ROOT] DATA_ROOT [subtree .. ]\n" +
" opengrok.jar [-O | -l | -t] DATA_ROOT\n" +
"\t-q run quietly\n" +
"\t-e economical - consumes less disk space\n" +
"\t-c path to ctags\n" +
"\t-w root URL of the webapp, default is /source\n" +
"\t-i ignore named files or directories\n" +
"\t-S Search and add \"External\" repositories (Mercurial...)\n" +
"\t-s SRC_ROOT is root directory of source tree\n" +
"\t default: last used SRC_ROOT\n" +
"\tDATA_ROOT - is where output of indexer is stored\n" +
"\tsubtree - only specified files or directories under SRC_ROOT are processed\n" +
"\t if not specified all files under SRC_ROOT are processed\n" +
"\n\t-O optimize the index \n" +
"\t-l list all files in the index \n" +
"\t-t lists tokens occuring more than 5 times. Useful for building a unix dictionary\n" +
"\n Eg. java -jar opengrok.jar -s /usr/include /var/tmp/opengrok_data rpc";
if (GraphicsEnvironment.isHeadless()) {
} else {
}
//Run Scope GUI here I am running Indexing GUI for testing
//new IndexerWizard(null).setVisible(true);
} else {
boolean searchRepositories = false;
try{
}
} else {
}
}
verbose = false;
economical = true;
}
;
} else {
}
} else {
}
}
} else {
}
} else {
}
if(!srcRootDir.isDirectory()) {
}
}
}
searchRepositories = true;
else
} else {
}
}
}
try {
} catch (IOException e) {
}
}
}
if(!srcRootDir.isDirectory()) {
}
}
}
if (searchRepositories) {
}
Index idx = new Index(verbose ? new StandardPrinter(System.out) : new NullPrinter(), new StandardPrinter(System.err));
} catch ( Exception e) {
if (verbose) e.printStackTrace();
}
}
}
}