(no commit message)
[utils] / crawler / kiss / src / main / java / org / wamblee / crawler / kiss / main / SystemProperties.java
1 /*
2  * Copyright 2005 the original author or authors.
3  * 
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  * 
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  * 
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17 package org.wamblee.crawler.kiss.main;
18
19 /**
20  * Access to system properties for the crawler.
21  *
22  * @author Erik Brakkee
23  */
24 public final class SystemProperties {
25
26     private static final String DEBUG_PROPERTY = "kiss.debug";
27
28     private static final String NO_PROGRAM_DETAILS = "kiss.nodetails";
29
30     private static final String DISABLE_RECORD = "kiss.norecord";
31
32     /**
33      * Disabled constructor.
34      * 
35      */
36     private SystemProperties() {
37         // Empty.
38     }
39
40     /**
41      * Determines if the system is run in debug mode. When in debug mode, less
42      * extensive crawling is done.
43      * 
44      * @return True iff we are running in debug mode.
45      */
46     public static boolean isDebugMode() {
47         return System.getProperties().getProperty(DEBUG_PROPERTY) != null;
48     }
49
50     /**
51      * Determines if no program details are required.
52      * 
53      * @return True iff no program details are required.
54      */
55     public static boolean isNoProgramDetailsRequired() {
56         return System.getProperties().getProperty(NO_PROGRAM_DETAILS) != null;
57     }
58
59     /**
60      * Determines if recording is disabled.
61      * 
62      * @return True iff no recording should be done.
63      */
64     public static boolean isRecordDisabled() {
65         return System.getProperties().getProperty(DISABLE_RECORD) != null;
66     }
67
68 }