C# Class SharpCifs.Config

This class uses a static Sharpen.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.
Afficher le fichier Open project: brandonprry/Potato

Méthodes publiques

Свойство Type Description
DefaultOemEncoding string
signalHandler System.Threading.AutoResetEvent
signalHandlerClient System.Threading.AutoResetEvent

Méthodes publiques

Méthode Description
Get ( string key ) : object

Retrieve a property as an Object.

Retrieve a property as an Object.

GetBoolean ( string key, bool def ) : bool

Retrieve a boolean value.

Retrieve a boolean value. If the property is not found, the value of def is returned.

GetInetAddress ( string key, IPAddress def ) : IPAddress

Retrieve an InetAddress.

Retrieve an InetAddress. If the address is not an IP address and cannot be resolved null will be returned.

GetInetAddressArray ( string key, string delim, IPAddress def ) : System.Net.IPAddress[]

Retrieve an array of InetAddress created from a property value containting a delim separated list of hostnames and/or ipaddresses.

Retrieve an array of InetAddress created from a property value containting a delim separated list of hostnames and/or ipaddresses.

GetInt ( string key ) : int

Retrieve an int.

Retrieve an int. If the property is not found, -1 is returned.

GetInt ( string key, int def ) : int

Retrieve an int.

Retrieve an int. If the key does not exist or cannot be converted to an int, the provided default argument will be returned.

GetLocalHost ( ) : IPAddress
GetLong ( string key, long def ) : long

Retrieve a long.

Retrieve a long. If the key does not exist or cannot be converted to a long, the provided default argument will be returned.

GetProperty ( string key ) : string

Retrieve a String.

Retrieve a String. If the property is not found, null is returned.

GetProperty ( string key, string def ) : string

Retrieve a String.

Retrieve a String. If the key cannot be found, the provided def default parameter will be returned.

Load ( InputStream input ) : void

Load the Config with properties from the stream in from a Properties file.

Load the Config with properties from the stream in from a Properties file.

RegisterSmbURLHandler ( ) : void

This static method registers the SMB URL protocol handler which is required to use SMB URLs with the java.net.URL class.

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 ( Properties prp ) : void

Set the default properties of the static Properties used by Config.

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.

SetProperty ( string key, string value ) : void

Add a property.

Add a property.

Store ( SharpCifs.Util.Sharpen.OutputStream output, string header ) : void
getNtlmContextFactory ( ) : INtlmContextFactory
setNtlmContextFactory ( INtlmContextFactory factory ) : void

Private Methods

Méthode Description
Config ( ) : System

Method Details

Get() public static méthode

Retrieve a property as an Object.
Retrieve a property as an Object.
public static Get ( string key ) : object
key string
Résultat object

GetBoolean() public static méthode

Retrieve a boolean value.
Retrieve a boolean value. If the property is not found, the value of def is returned.
public static GetBoolean ( string key, bool def ) : bool
key string
def bool
Résultat bool

GetInetAddress() public static méthode

Retrieve an InetAddress.
Retrieve an InetAddress. If the address is not an IP address and cannot be resolved null will be returned.
public static GetInetAddress ( string key, IPAddress def ) : IPAddress
key string
def System.Net.IPAddress
Résultat System.Net.IPAddress

GetInetAddressArray() public static méthode

Retrieve an array of InetAddress created from a property value containting a delim separated list of hostnames and/or ipaddresses.
Retrieve an array of InetAddress created from a property value containting a delim separated list of hostnames and/or ipaddresses.
public static GetInetAddressArray ( string key, string delim, IPAddress def ) : System.Net.IPAddress[]
key string
delim string
def System.Net.IPAddress
Résultat System.Net.IPAddress[]

GetInt() public static méthode

Retrieve an int.
Retrieve an int. If the property is not found, -1 is returned.
public static GetInt ( string key ) : int
key string
Résultat int

GetInt() public static méthode

Retrieve an int.
Retrieve an int. If the key does not exist or cannot be converted to an int, the provided default argument will be returned.
public static GetInt ( string key, int def ) : int
key string
def int
Résultat int

GetLocalHost() public static méthode

public static GetLocalHost ( ) : IPAddress
Résultat System.Net.IPAddress

GetLong() public static méthode

Retrieve a long.
Retrieve a long. If the key does not exist or cannot be converted to a long, the provided default argument will be returned.
public static GetLong ( string key, long def ) : long
key string
def long
Résultat long

GetProperty() public static méthode

Retrieve a String.
Retrieve a String. If the property is not found, null is returned.
public static GetProperty ( string key ) : string
key string
Résultat string

GetProperty() public static méthode

Retrieve a String.
Retrieve a String. If the key cannot be found, the provided def default parameter will be returned.
public static GetProperty ( string key, string def ) : string
key string
def string
Résultat string

Load() public static méthode

Load the Config with properties from the stream in from a Properties file.
Load the Config with properties from the stream in from a Properties file.
public static Load ( InputStream input ) : void
input SharpCifs.Util.Sharpen.InputStream
Résultat void

RegisterSmbURLHandler() public static méthode

This static method registers the SMB URL protocol handler which is required to use SMB URLs with the java.net.URL class.
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) ... 
public static RegisterSmbURLHandler ( ) : void
Résultat void

SetProperties() public static méthode

Set the default properties of the static Properties used by Config.
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.
public static SetProperties ( Properties prp ) : void
prp SharpCifs.Util.Sharpen.Properties
Résultat void

SetProperty() public static méthode

Add a property.
Add a property.
public static SetProperty ( string key, string value ) : void
key string
value string
Résultat void

Store() public static méthode

public static Store ( SharpCifs.Util.Sharpen.OutputStream output, string header ) : void
output SharpCifs.Util.Sharpen.OutputStream
header string
Résultat void

getNtlmContextFactory() public static méthode

public static getNtlmContextFactory ( ) : INtlmContextFactory
Résultat INtlmContextFactory

setNtlmContextFactory() public static méthode

public static setNtlmContextFactory ( INtlmContextFactory factory ) : void
factory INtlmContextFactory
Résultat void

Property Details

DefaultOemEncoding public_oe static_oe property

public static string DefaultOemEncoding
Résultat string

signalHandler public_oe static_oe property

public static AutoResetEvent,System.Threading signalHandler
Résultat System.Threading.AutoResetEvent

signalHandlerClient public_oe static_oe property

public static AutoResetEvent,System.Threading signalHandlerClient
Résultat System.Threading.AutoResetEvent