Configuration.java revision 253
58N/A/*
58N/A * CDDL HEADER START
58N/A *
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 *
58N/A * See LICENSE.txt included in this distribution for the specific
58N/A * language governing permissions and limitations under the License.
58N/A *
58N/A * When distributing Covered Code, include this CDDL HEADER in each
58N/A * file and include the License file at LICENSE.txt.
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]
58N/A *
58N/A * CDDL HEADER END
58N/A */
58N/A
58N/A/*
1291N/A * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
58N/A * Use is subject to license terms.
58N/A */
58N/Apackage org.opensolaris.opengrok.configuration;
234N/A
234N/Aimport java.beans.XMLDecoder;
234N/Aimport java.beans.XMLEncoder;
234N/Aimport java.io.BufferedInputStream;
1287N/Aimport java.io.BufferedOutputStream;
639N/Aimport java.io.File;
639N/Aimport java.io.FileInputStream;
234N/Aimport java.io.FileOutputStream;
234N/Aimport java.io.IOException;
234N/Aimport java.util.ArrayList;
1289N/Aimport java.util.HashMap;
234N/Aimport java.util.List;
639N/Aimport java.util.Map;
639N/Aimport org.opensolaris.opengrok.history.ExternalRepository;
58N/Aimport org.opensolaris.opengrok.index.IgnoredNames;
1185N/A
667N/A/**
1185N/A * Placeholder class for all configuration variables. Due to the multithreaded
1016N/A * nature of the web application, each thread will use the same instance of the
1291N/A * configuration object for each page request. Class and methods should have
58N/A * package scope, but that didn't work with the XMLDecoder/XMLEncoder.
1185N/A */
1016N/Apublic class Configuration {
1185N/A private String ctags;
664N/A private boolean historyCache;
1026N/A private int historyCacheTime;
112N/A private List<Project> projects;
1195N/A private String sourceRoot;
58N/A private String dataRoot;
58N/A private Map<String, ExternalRepository> repositories;
77N/A private String urlPrefix;
77N/A private boolean generateHtml;
77N/A private Project defaultProject;
77N/A private int indexWordLimit;
58N/A private boolean verbose;
418N/A private boolean allowLeadingWildcard;
58N/A private IgnoredNames ignoredNames;
773N/A private String userPage;
773N/A private String bugPage;
58N/A private String bugPattern;
773N/A private String webappLAF;
773N/A private boolean remoteScmSupported;
773N/A private boolean optimizeDatabase;
773N/A
58N/A /** Creates a new instance of Configuration */
773N/A public Configuration() {
773N/A setHistoryCache(true);
773N/A setHistoryCacheTime(30);
773N/A setProjects(new ArrayList<Project>());
58N/A setRepositories(new HashMap<String, ExternalRepository>());
58N/A setUrlPrefix("/source/s?");
58N/A setCtags("ctags");
664N/A setIndexWordLimit(60000);
58N/A setVerbose(false);
65N/A setGenerateHtml(true);
894N/A setQuickContextScan(true);
77N/A setIgnoredNames(new IgnoredNames());
99N/A setUserPage("http://www.opensolaris.org/viewProfile.jspa?username=");
99N/A setBugPage("http://bugs.opensolaris.org/bugdatabase/view_bug.do?bug_id=");
1115N/A setBugPattern("\\b([12456789][0-9]{6})\\b");
1115N/A setWebappLAF("default");
125N/A setRemoteScmSupported(false);
112N/A setOptimizeDatabase(true);
1026N/A }
129N/A
1100N/A public String getCtags() {
129N/A return ctags;
129N/A }
318N/A
318N/A public void setCtags(String ctags) {
144N/A this.ctags = ctags;
173N/A }
253N/A
296N/A public boolean isHistoryCache() {
335N/A return historyCache;
480N/A }
816N/A
816N/A public void setHistoryCache(boolean historyCache) {
833N/A this.historyCache = historyCache;
833N/A }
1393N/A
1185N/A public int getHistoryCacheTime() {
1016N/A return historyCacheTime;
1123N/A }
1125N/A
1218N/A public void setHistoryCacheTime(int historyCacheTime) {
Error!

 

There was an error!

null

java.lang.NullPointerException