|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object jcifs.Config
This class uses a static Properties
to act
as a cental repository for all jCIFS configuration properties. It cannot be
instantiated. Similar to System
properties the namespace
is global therefore property names should be unique. Before use,
the load
method should be called with the name of a
Properties
file (or null
indicating no
file) to initialize the Config
. The System
properties will then populate the Config
as well potentially
overwriting properties from the file. Thus properties provided on the
commandline with the -Dproperty.name=value
VM parameter
will override properties from the configuration file.
There are several ways to set jCIFS properties. See the overview page of the API documentation for details.
Field Summary | |
static java.lang.String |
DEFAULT_OEM_ENCODING
|
Method Summary | |
static java.lang.Object |
get(java.lang.String key)
Retrieve a property as an Object . |
static boolean |
getBoolean(java.lang.String key,
boolean def)
Retrieve a boolean value. |
static java.net.InetAddress |
getInetAddress(java.lang.String key,
java.net.InetAddress def)
Retrieve an InetAddress . |
static java.net.InetAddress[] |
getInetAddressArray(java.lang.String key,
java.lang.String delim,
java.net.InetAddress[] def)
Retrieve an array of InetAddress created from a property value containting a delim separated list of hostnames and/or ipaddresses. |
static int |
getInt(java.lang.String key)
Retrieve an int . |
static int |
getInt(java.lang.String key,
int def)
Retrieve an int . |
static java.net.InetAddress |
getLocalHost()
|
static long |
getLong(java.lang.String key,
long def)
Retrieve a long . |
static java.lang.String |
getProperty(java.lang.String key)
Retrieve a String . |
static java.lang.String |
getProperty(java.lang.String key,
java.lang.String def)
Retrieve a String . |
static void |
list(java.io.PrintStream out)
List the properties in the Code . |
static void |
load(java.io.InputStream in)
Load the Config with properties from the stream
in from a Properties file. |
static void |
registerSmbURLHandler()
This static method registers the SMB URL protocol handler which is required to use SMB URLs with the java.net.URL class. |
static void |
setProperties(java.util.Properties prp)
Set the default properties of the static Properties used by Config. |
static java.lang.Object |
setProperty(java.lang.String key,
java.lang.String value)
Add a property. |
static void |
store(java.io.OutputStream out,
java.lang.String header)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static java.lang.String DEFAULT_OEM_ENCODING
Method Detail |
public static void registerSmbURLHandler()
Exception MalformedURLException: unknown protocol: smb at java.net.URL.(URL.java:480) at java.net.URL. (URL.java:376) at java.net.URL. (URL.java:330) at jcifs.smb.SmbFile. (SmbFile.java:355) ...
public static void setProperties(java.util.Properties prp)
public static void load(java.io.InputStream in) throws java.io.IOException
Config
with properties from the stream
in
from a Properties
file.
java.io.IOException
public static void store(java.io.OutputStream out, java.lang.String header) throws java.io.IOException
java.io.IOException
public static void list(java.io.PrintStream out) throws java.io.IOException
Code
.
java.io.IOException
public static java.lang.Object setProperty(java.lang.String key, java.lang.String value)
public static java.lang.Object get(java.lang.String key)
Object
.
public static java.lang.String getProperty(java.lang.String key, java.lang.String def)
String
. If the key cannot be found,
the provided def
default parameter will be returned.
public static java.lang.String getProperty(java.lang.String key)
String
. If the property is not found, null
is returned.
public static int getInt(java.lang.String key, int def)
int
. If the key does not exist or
cannot be converted to an int
, the provided default
argument will be returned.
public static int getInt(java.lang.String key)
int
. If the property is not found, -1
is returned.
public static long getLong(java.lang.String key, long def)
long
. If the key does not exist or
cannot be converted to a long
, the provided default
argument will be returned.
public static java.net.InetAddress getInetAddress(java.lang.String key, java.net.InetAddress def)
InetAddress
. If the address is not
an IP address and cannot be resolved null
will
be returned.
public static java.net.InetAddress getLocalHost()
public static boolean getBoolean(java.lang.String key, boolean def)
def
is returned.
public static java.net.InetAddress[] getInetAddressArray(java.lang.String key, java.lang.String delim, java.net.InetAddress[] def)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |