Servertec
Foundation Classes
1.3.3 09/04/2005

stec.sfc.Win32
Class Network

java.lang.Object
  extended by stec.sfc.Win32.Network

public final class Network
extends java.lang.Object

Contains methods used to interface with the network.

Since:
1.2.0 12/03/2002

Constructor Summary
Network()
           
 
Method Summary
static void addConnection(java.lang.String local_name, java.lang.String remote_name, boolean update_profile)
          Makes a connection to the named resource.
static void addConnection(java.lang.String local_name, java.lang.String remote_name, java.lang.String username, java.lang.String password, boolean update_profile)
          Makes a connection to the named resource.
static void deleteConnection(java.lang.String local_name, boolean update_profile, boolean force)
          Cancels an existing network connection.
static NetworkResourceEnumerator getDomains(java.lang.String provider)
          Returns a new NetworkResourceEnumerator of domains.
static java.lang.String getHostname()
          Returns the hostname.
static NetworkResourceEnumerator getLocalShares()
          Returns a new NetworkResourceEnumerator of local shares.
static NetworkResourceEnumerator getNeighborhoodResources()
          Returns a new NetworkResourceEnumerator of the neighborhood.
static java.lang.String getProvider(int network_type)
          Returns the name of the provider for the specified network type.
static NetworkResourceEnumerator getProviders()
          Returns a new NetworkResourceEnumerator of network providers.
static java.lang.String getRemoteName(java.lang.String local_name)
          Returns the remote name of the named resource.
static NetworkResourceEnumerator getRemoteShares(java.lang.String remote_name)
          Returns a new NetworkResourceEnumerator of remote shares on the named remote resource.
static java.lang.String getUniversalName(java.lang.String local_name)
          Returns the Universal Naming Convention (UNC) of the specified mapped resource.
static java.lang.String getUserName()
          Returns the current user name.
static java.lang.String getUserName(java.lang.String resource_name)
          Returns the user name for the named resource.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Network

public Network()
Method Detail

getRemoteName

public static final java.lang.String getRemoteName(java.lang.String local_name)
                                            throws java.io.IOException
Returns the remote name of the named resource.

Parameters:
local_name - the local name of the resource.
Returns:
the remote name of the resource.
Throws:
java.io.Exception - if any exception occurs.
java.io.IOException

getUniversalName

public static final java.lang.String getUniversalName(java.lang.String local_name)
                                               throws java.io.IOException
Returns the Universal Naming Convention (UNC) of the specified mapped resource.

Parameters:
local_name - the local name of the resource.
Returns:
the UNC for the resource.
Throws:
java.io.Exception - if any exception occurs.
java.io.IOException

getUserName

public static final java.lang.String getUserName(java.lang.String resource_name)
                                          throws java.io.IOException
Returns the user name for the named resource.

Parameters:
resource_name - the resource name. If resource_name is null then returns the current user name.
Returns:
the user name.
Throws:
java.io.Exception - if any exception occurs.
java.io.IOException

getProvider

public static final java.lang.String getProvider(int network_type)
                                          throws java.io.IOException
Returns the name of the provider for the specified network type.

Parameters:
network_type - the network type.
Returns:
the name of the provider.
Throws:
java.io.Exception - if any exception occurs.
java.io.IOException

addConnection

public static final void addConnection(java.lang.String local_name,
                                       java.lang.String remote_name,
                                       java.lang.String username,
                                       java.lang.String password,
                                       boolean update_profile)
                                throws java.io.IOException
Makes a connection to the named resource.

Parameters:
local_name - the local name. Normally a device name. For example R:.
remote_name - the remote name of the resource.
username - the user name.
password - the password.
update_profile - whether to update the user provider. Indicates that the system should restore the connection when the user logs on again.
Throws:
java.io.Exception - if any exception occurs.
java.io.IOException

deleteConnection

public static final void deleteConnection(java.lang.String local_name,
                                          boolean update_profile,
                                          boolean force)
                                   throws java.io.IOException
Cancels an existing network connection.

Parameters:
local_name - the local name. Normally a device name. For example R:.
update_profile - whether to update the user profile. Indicates that the system shoould not restore the connection when the user logs on again.
Throws:
java.io.IOException

getHostname

public static final java.lang.String getHostname()
                                          throws java.io.IOException
Returns the hostname.

Returns:
the hostname.
Throws:
java.io.Exception - if any exception occurs.
java.io.IOException

getUserName

public static final java.lang.String getUserName()
                                          throws java.io.IOException
Returns the current user name.

Returns:
the user name.
Throws:
java.io.Exception - if any exception occurs.
java.io.IOException

addConnection

public static final void addConnection(java.lang.String local_name,
                                       java.lang.String remote_name,
                                       boolean update_profile)
                                throws java.io.IOException
Makes a connection to the named resource.

Parameters:
local_name - the local name. Normally a device name. For example R:.
remote_name - the remote name of the resource.
update_profile - whether to update the user provider. Indicates that the system should restore the connection when the user logs on again.
Throws:
java.io.Exception - if any exception occurs.
java.io.IOException

getProviders

public static final NetworkResourceEnumerator getProviders()
                                                    throws java.io.IOException
Returns a new NetworkResourceEnumerator of network providers.

Returns:
the new NetworkResourceEnumerator of network providers.
Throws:
java.io.Exception - if any exception occurs.
java.io.IOException

getDomains

public static final NetworkResourceEnumerator getDomains(java.lang.String provider)
                                                  throws java.io.IOException
Returns a new NetworkResourceEnumerator of domains.

Parameters:
provider - the name of the provider.
Returns:
the new NetworkResourceEnumerator of domains.
Throws:
java.io.Exception - if any exception occurs.
java.io.IOException

getNeighborhoodResources

public static final NetworkResourceEnumerator getNeighborhoodResources()
                                                                throws java.io.IOException
Returns a new NetworkResourceEnumerator of the neighborhood.

Returns:
the new NetworkResourceEnumerator of the neighborhood.
Throws:
java.io.Exception - if any exception occurs.
java.io.IOException

getLocalShares

public static final NetworkResourceEnumerator getLocalShares()
                                                      throws java.io.IOException
Returns a new NetworkResourceEnumerator of local shares.

Returns:
the new NetworkResourceEnumerator of local shares.
Throws:
java.io.Exception - if any exception occurs.
java.io.IOException

getRemoteShares

public static final NetworkResourceEnumerator getRemoteShares(java.lang.String remote_name)
                                                       throws java.io.IOException
Returns a new NetworkResourceEnumerator of remote shares on the named remote resource.

Parameters:
remote_name - the remote resource to enumerate.
Returns:
the new NetworkResourceEnumerator of remote shares on the named remote resource.
Throws:
java.io.Exception - if any exception occurs.
java.io.IOException

Servertec
Foundation Classes
1.3.3 09/04/2005

Copyright © 2001-2005 Servertec. All rights reserved.