C# Класс 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.
Показать файл Открыть проект

Открытые свойства

Свойство Тип Описание
DefaultOemEncoding string
signalHandler System.Threading.AutoResetEvent
signalHandlerClient System.Threading.AutoResetEvent

Открытые методы

Метод Описание
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

Приватные методы

Метод Описание
Config ( ) : System

Описание методов

Get() публичный статический Метод

Retrieve a property as an Object.
Retrieve a property as an Object.
public static Get ( string key ) : object
key string
Результат object

GetBoolean() публичный статический Метод

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
Результат bool

GetInetAddress() публичный статический Метод

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
Результат System.Net.IPAddress

GetInetAddressArray() публичный статический Метод

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
Результат System.Net.IPAddress[]

GetInt() публичный статический Метод

Retrieve an int.
Retrieve an int. If the property is not found, -1 is returned.
public static GetInt ( string key ) : int
key string
Результат int

GetInt() публичный статический Метод

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
Результат int

GetLocalHost() публичный статический Метод

public static GetLocalHost ( ) : IPAddress
Результат System.Net.IPAddress

GetLong() публичный статический Метод

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
Результат long

GetProperty() публичный статический Метод

Retrieve a String.
Retrieve a String. If the property is not found, null is returned.
public static GetProperty ( string key ) : string
key string
Результат string

GetProperty() публичный статический Метод

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
Результат string

Load() публичный статический Метод

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
Результат void

RegisterSmbURLHandler() публичный статический Метод

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
Результат void

SetProperties() публичный статический Метод

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
Результат void

SetProperty() публичный статический Метод

Add a property.
Add a property.
public static SetProperty ( string key, string value ) : void
key string
value string
Результат void

Store() публичный статический Метод

public static Store ( SharpCifs.Util.Sharpen.OutputStream output, string header ) : void
output SharpCifs.Util.Sharpen.OutputStream
header string
Результат void

getNtlmContextFactory() публичный статический Метод

public static getNtlmContextFactory ( ) : INtlmContextFactory
Результат INtlmContextFactory

setNtlmContextFactory() публичный статический Метод

public static setNtlmContextFactory ( INtlmContextFactory factory ) : void
factory INtlmContextFactory
Результат void

Описание свойств

DefaultOemEncoding публичное статическое свойство

public static string DefaultOemEncoding
Результат string

signalHandler публичное статическое свойство

public static AutoResetEvent,System.Threading signalHandler
Результат System.Threading.AutoResetEvent

signalHandlerClient публичное статическое свойство

public static AutoResetEvent,System.Threading signalHandlerClient
Результат System.Threading.AutoResetEvent