| java.lang.Object com.knowgate.jcifs.Config
Config | public class Config (Code) | | This class uses a static
java.util.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.
|
getBoolean | public static boolean getBoolean(String key, boolean def)(Code) | | Retrieve a boolean value. If the property is not found, the value of def is returned.
|
getInetAddress | public static InetAddress getInetAddress(String key, InetAddress def)(Code) | | Retrieve an InetAddress . If the address is not
an IP address and cannot be resolved null will
be returned.
|
getInetAddressArray | public static InetAddress[] getInetAddressArray(String key, String delim, InetAddress[] def)(Code) | | Retrieve an array of InetAddress created from a property
value containting a delim separated list of hostnames and/or
ipaddresses.
|
getInt | public static int getInt(String key, int def)(Code) | | Retrieve an int . If the key does not exist or
cannot be converted to an int , the provided default
argument will be returned.
|
getInt | public static int getInt(String key)(Code) | | Retrieve an int . If the property is not found, -1 is returned.
|
getLong | public static long getLong(String key, long def)(Code) | | Retrieve a long . If the key does not exist or
cannot be converted to a long , the provided default
argument will be returned.
|
getProperty | public static String getProperty(String key, String def)(Code) | | Retrieve a String . If the key cannot be found,
the provided def default parameter will be returned.
|
getProperty | public static String getProperty(String key)(Code) | | Retrieve a String . If the property is not found, null is returned.
|
load | public static void load(InputStream in) throws IOException(Code) | | Load the Config with properties from the stream
in from a Properties file.
|
registerSmbURLHandler | public static void registerSmbURLHandler()(Code) | | This static method registers the SMB URL protocol handler which is
required to use SMB URLs with the java.net.URL class. If this
method is not called before attempting to create an SMB URL with the
URL class the following exception will occur:
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)
...
|
setProperties | public static void setProperties(Properties prp)(Code) | | Set the default properties of the static Properties used by Config. This permits
a different Properties object/file to be used as the source of properties for
use by the jCIFS library. The Properties must be set before jCIFS
classes are accessed as most jCIFS classes load properties statically once.
Using this method will also override properties loaded
using the -Djcifs.properties= commandline parameter.
|
|
|