RuntimeEnvironment.java revision 1327
58N/A * CDDL HEADER START 58N/A * The contents of this file are subject to the terms of the 58N/A * Common Development and Distribution License (the "License"). 58N/A * You may not use this file except in compliance with the License. 58N/A * language governing permissions and limitations under the License. 58N/A * When distributing Covered Code, include this CDDL HEADER in each 58N/A * If applicable, add the following below this CDDL HEADER, with the 58N/A * fields enclosed by brackets "[]" replaced with your own identifying 58N/A * information: Portions Copyright [yyyy] [name of copyright owner] 1291N/A * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. 1026N/A * The RuntimeEnvironment class is used as a placeholder for the current 112N/A * configuration this execution context (classloader) is using. 1462N/A * Get the one and only instance of the RuntimeEnvironment 1462N/A * @return the one and only instance of the RuntimeEnvironment 1356N/A * Creates a new instance of RuntimeEnvironment. Private to ensure a 58N/A * Get the path to the where the index database is stored 58N/A * @return the path to the index database 1436N/A * Get a file representing the index database 1436N/A * @return the index database 129N/A * Set the path to where the index database is stored 318N/A * @param dataRoot the index database 480N/A * Get the path to where the sources are located 816N/A * @return path to where the sources are located 1123N/A * Get a file representing the directory where the sources are located 1125N/A * @return A file representing the directory where the sources are located 1252N/A * @param sourceRoot the location of the sources 1185N/A * Returns a path relative to source root. This would just be a simple 1185N/A * substring operation, except we need to support symlinks outside the 1185N/A * @param file A file to resolve 1185N/A * @param stripCount Number of characters past source root to strip 1252N/A * @throws IOException If an IO error occurs 1185N/A * @throws FileNotFoundException If the file is not relative to source root 1185N/A * @return Path relative to source root 993N/A * @return true if we have projects 58N/A * Get all of the projects 773N/A * @return a list containing all of the projects (may be null) 870N/A * Set the list of the projects 870N/A * @param projects the list of projects to use 129N/A * subsequent calls to the RuntimeEnvironment from this thread will use 129N/A * the same configuration 875N/A * @return this instance 816N/A * Get the context name of the web application 816N/A * @return the web applications context name 1463N/A * @param urlPrefix the web applications context name 1463N/A * Get the name of the ctags program in use 1463N/A * @return the name of the ctags program in use 1463N/A * Specify the CTags program to use 1463N/A * @param ctags the ctags program to use 1463N/A * Validate that I have a Exuberant ctags program I may use 1463N/A * @return true if success, false otherwise 1461N/A "Please use option -c to specify path to a good Exuberant Ctags program\n"+
1461N/A "Or set it in java system property " 1461N/A * Get the max time a SMC operation may use to avoid beeing cached 1185N/A * Specify the maximum time a SCM operation should take before it will 1185N/A * @param historyReaderTimeLimit the max time in ms before it is cached 1461N/A * Is history cache currently enabled? 1461N/A * @return true if history cache is enabled 1190N/A * Specify if we should use history cache or not 1461N/A * @param useHistoryCache set false if you do not want to use history cache 1185N/A * Should the history cache be stored in a database instead of in XML 1190N/A * @return {@code true} if the cache should be stored in a database 58N/A * Set whether the history cache should be stored in a database. 937N/A * @param store {@code true} if the cache should be stored in a database 58N/A * Should we generate HTML or not during the indexing phase 937N/A * @return true if HTML should be generated during the indexing phase 816N/A * Specify if we should generate HTML or not during the indexing phase 816N/A * @param generateHtml set this to true to pregenerate HTML 1461N/A * Set if we should compress the xref files or not 1461N/A * @param compressXref set to true if the generated html files should be 1461N/A * Are we using compressed HTML files? 816N/A * @return {@code true} if the html-files should be compressed. 58N/A * Set the map of external SCM repositories 58N/A * @param repositories the repositories to use 58N/A * Set the project that is specified to be the default project to use. The 58N/A * default project is the project you will search (from the web application) 58N/A * if the page request didn't contain the cookie.. 773N/A * @param defaultProject The default project to use 773N/A * Get the project that is specified to be the default project to use. The 773N/A * default project is the project you will search (from the web application) 58N/A * if the page request didn't contain the cookie.. 58N/A * @return the default project (may be null if not specified) 773N/A * Chandan wrote the following answer on the opengrok-discuss list: 773N/A * "Traditionally search engines (specially spiders) think that large files 58N/A * are junk. Large files tend to be multimedia files etc., which text 58N/A * search spiders do not want to chew. So they ignore the contents of 58N/A * the file after a cutoff length. Lucene does this by number of words, 773N/A * which is by default is 10,000." 773N/A * By default OpenGrok will increase this limit to 60000, but it may be 773N/A * overridden in the configuration file 773N/A * @return The maximum words to index 773N/A * Set the number of words in a file Lucene will index. 773N/A * See getIndexWordLimit for a better description. 773N/A * @param indexWordLimit the number of words to index in a single file 773N/A * Is the verbosity flag turned on? 773N/A * @return true if we can print extra information 1461N/A * Set the verbosity flag (to add extra debug information in output) 58N/A * @param verbose new value 1461N/A * Is the progress print flag turned on? 58N/A * @return true if we can print per project progress % 1461N/A * Set the printing of progress % flag (user convenience) 58N/A * @param printP new value 1461N/A * Specify if a search may start with a wildcard. Note that queries 58N/A * that start with a wildcard will give a significant impact on the 58N/A * search performace. 58N/A * @param allowLeadingWildcard set to true to activate (disabled by default) 58N/A * Is leading wildcards allowed? 58N/A * @return true if a search may start with a wildcard 58N/A * Returns the user page for the history listing 58N/A * @return the URL string fragment preceeding the username 1469N/A * Get the client command to use to access the repository for the given 1469N/A * fully quallified classname. 1461N/A * @param clazzName name of the targeting class 58N/A * @return {@code null} if not yet set, the client command otherwise. 1436N/A * Set the client command to use to access the repository for the given 1436N/A * fully quallified classname. 1436N/A * @param clazzName name of the targeting class. If {@code null} this method 1185N/A * @param cmd the client command to use. If {@code null} the corresponding 58N/A * entry for the given clazzName get removed. 58N/A * @return the client command previously set, which might be {@code null}. 1461N/A * Sets the user page for the history listing 1461N/A * @param userPage the URL fragment preceeding the username from history 1461N/A * Returns the user page suffix for the history listing 1461N/A * @return the URL string fragment following the username 1461N/A * Sets the user page suffix for the history listing 1461N/A * @param userPageSuffix the URL fragment following the username from history 77N/A * Returns the bug page for the history listing 937N/A * @return the URL string fragment preceeding the bug ID 77N/A * Sets the bug page for the history listing 77N/A * @param bugPage the URL fragment preceeding the bug ID 1461N/A * Returns the bug regex for the history listing 1461N/A * @return the regex that is looked for in history comments 99N/A * Sets the bug regex for the history listing 99N/A * @param bugPattern the regex to search history comments 99N/A * Returns the review(ARC) page for the history listing 99N/A * @return the URL string fragment preceeding the review page ID 99N/A * Sets the review(ARC) page for the history listing 99N/A * @param reviewPage the URL fragment preceeding the review page ID 99N/A * Returns the review(ARC) regex for the history listing 99N/A * @return the regex that is looked for in history comments 1115N/A * Sets the review(ARC) regex for the history listing 1115N/A * @param reviewPattern the regex to search history comments 1461N/A * Return whether e-mail addresses should be obfuscated in the xref. 1461N/A * Set whether e-mail addresses should be obfuscated in the xref. 1026N/A * Should status.jsp print internal settings, like paths and database 1469N/A * @return {@code true} if status.jsp should show the configuration, 1461N/A * Set whether status.jsp should print internal settings. 1469N/A * @param chatty {@code true} if internal settings should be printed, 1469N/A * Read an configuration file and set it as the current configuration. 1469N/A * @param file the file to read 1461N/A * @throws IOException if an error occurs 1469N/A * Write the current configuration to a file 1461N/A * @param file the file to write the configuration into 1100N/A * @throws IOException if an error occurs 1461N/A * Write the current configuration to a socket 129N/A * @param host the host address to receive the configuration 129N/A * @param port the port to use on the host 129N/A * @throws IOException if an error occurs 1469N/A * Try to stop the configuration listener thread 1461N/A * Start a thread to listen on a socket to receive new configurations 1469N/A * @param endpoint The socket address to listen on 1461N/A * @return true if the endpoint was available (and the thread was started)