|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.nutch.util.NutchConf
Provides access to Nutch configuration parameters.
Default values for all parameters are specified in a file named nutch-default.xml located on the classpath. Overrides for these defaults should be in an optional file named nutch-site.xml, also located on the classpath. Typically these files reside in the conf/ subdirectory at the top-level of a Nutch installation.
Constructor Summary | |
NutchConf()
|
Method Summary | |
static void |
addConfResource(String name)
Adds a resource name to the chain of resources read. |
static String |
get(String name)
Returns the value of the name property, or null if no
such property exists. |
static String |
get(String name,
String defaultValue)
Returns the value of the name property. |
static boolean |
getBoolean(String name,
boolean defaultValue)
Returns the value of the name property as an boolean. |
static InputStream |
getConfResourceAsInputStream(String name)
Returns an input stream attached to the configuration resource with the given name . |
static Reader |
getConfResourceAsReader(String name)
Returns a reader attached to the configuration resource with the given name . |
static float |
getFloat(String name,
float defaultValue)
Returns the value of the name property as a float. |
static int |
getInt(String name,
int defaultValue)
Returns the value of the name property as an integer. |
static long |
getLong(String name,
long defaultValue)
Returns the value of the name property as a long. |
static String[] |
getStrings(String name)
Returns the value of the name property as an array of
strings. |
static void |
main(String[] args)
For debugging. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public NutchConf()
Method Detail |
public static void addConfResource(String name)
public static String get(String name)
name
property, or null if no
such property exists.
public static String get(String name, String defaultValue)
name
property. If no such property
exists, then defaultValue
is returned.
public static int getInt(String name, int defaultValue)
name
property as an integer. If no
such property is specified, or if the specified value is not a valid
integer, then defaultValue
is returned.
public static long getLong(String name, long defaultValue)
name
property as a long. If no
such property is specified, or if the specified value is not a valid
long, then defaultValue
is returned.
public static float getFloat(String name, float defaultValue)
name
property as a float. If no
such property is specified, or if the specified value is not a valid
float, then defaultValue
is returned.
public static InputStream getConfResourceAsInputStream(String name)
name
.
public static Reader getConfResourceAsReader(String name)
name
.
public static boolean getBoolean(String name, boolean defaultValue)
name
property as an boolean. If no
such property is specified, or if the specified value is not a valid
boolean, then defaultValue
is returned. Valid boolean values
are "true" and "false".
public static String[] getStrings(String name)
name
property as an array of
strings. If no such property is specified, then null
is returned. Values are whitespace or comma delimted.
public static void main(String[] args)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |