Class NetServerFileShare
- java.lang.Object
-
- com.ibm.as400.resource.Resource
-
- com.ibm.as400.resource.ChangeableResource
-
- com.ibm.as400.access.NetServerShare
-
- com.ibm.as400.access.NetServerFileShare
-
- All Implemented Interfaces:
- java.io.Serializable
Deprecated.This class has been replaced by theISeriesNetServerFileShare
class and may be removed in a future release.
public class NetServerFileShare extends NetServerShare
The NetServerFileShare class represents a NetServer file server share. NetServerFileShare objects are created and returned byNetServer.listFileShares()
.Note: This class uses some API fields that are not available prior to OS/400 V5R1.
Note: The methods that add or change NetServer File Shares are not supported prior to OS/400 V5R1.
The following attribute IDs are supported:
Use any of the above attribute IDs with
getAttributeValue
andsetAttributeValue
to access the attribute values for a NetServerFileShare.
Note: For the above attributes, getAttributeValue() should never return null. For String-valued attributes, if the current actual value of the corresponding property on the system is blank, getAttributeValue() will return "" (an empty String).Note: Typically, methods which add, change, or remove a NetServerFileShare require that the system user profile has *IOSYSCFG special authority, or that the user own the integrated file system directory.
import com.ibm.as400.access.*; import com.ibm.as400.resource.*; // Create a NetServer object for a specific system. AS400 system = new AS400("MYSYSTEM", "MYUSERID", "MYPASSWORD"); NetServer ns = new NetServer(system); try { // List all current file shares. System.out.println("File shares:"); ResourceList shareList = ns.listFileShares(); shareList.waitForComplete(); for (int i=0; i<shareList.getListLength(); i++) { NetServerFileShare share = (NetServerFileShare)shareList.resourceAt(i); System.out.println(share.getName() + ": " + (String)share.getAttributeValue(NetServerFileShare.PATH) + ": " + (String)share.getAttributeValue(NetServerFileShare.DESCRIPTION) + "; " + ((Integer)share.getAttributeValue(NetServerFileShare.USER_COUNT)) .intValue() ); } } catch (ResourceException e) { e.printStackTrace(); } finally { if (system != null) system.disconnectAllServices(); }
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field and Description static java.lang.String
MAXIMUM_USERS
Deprecated.Attribute ID for "maximum users".static java.lang.String
PATH
Deprecated.Attribute ID for "path".static java.lang.String
PERMISSION
Deprecated.Attribute ID for "permission".static java.lang.Integer
PERMISSION_READ_ONLY
Deprecated.PERMISSION
attribute value indicating "read only" permission to a share.static java.lang.Integer
PERMISSION_READ_WRITE
Deprecated.PERMISSION
attribute value indicating "read/write" permission to a share.-
Fields inherited from class com.ibm.as400.access.NetServerShare
DESCRIPTION, USER_COUNT
-
-
Constructor Summary
Constructors Constructor and Description NetServerFileShare()
Deprecated.Constructs a NetServerFileShare object.NetServerFileShare(AS400 system, java.lang.String name)
Deprecated.Constructs a NetServerFileShare object.
-
Method Summary
Methods Modifier and Type Method and Description void
add()
Deprecated.Adds the file server share to the NetServer.protected void
commitAttributeChanges(java.lang.Object[] attributeIDs, java.lang.Object[] values)
Deprecated.Commits the specified attribute changes.protected void
establishConnection()
Deprecated.Establishes the connection to the system.-
Methods inherited from class com.ibm.as400.access.NetServerShare
freezeProperties, getAttributeUnchangedValue, getName, listConnections, refreshAttributeValues, remove, setName
-
Methods inherited from class com.ibm.as400.resource.ChangeableResource
cancelAttributeChanges, commitAttributeChanges, commitAttributeChanges, fireAttributeChangesCanceled, fireAttributeChangesCommitted, fireAttributeValueChanged, fireResourceCreated, fireResourceDeleted, getAttributeUnchangedValue, getAttributeValue, getAttributeValue, hasUncommittedAttributeChanges, initializeAttributeValue, setAttributeValue, setAttributeValue
-
Methods inherited from class com.ibm.as400.resource.Resource
addActiveStatusListener, addPropertyChangeListener, addResourceListener, addVetoableChangeListener, arePropertiesFrozen, equals, fireAttributeValuesRefreshed, fireBusy, fireIdle, firePropertyChange, fireVetoableChange, getAttributeMetaData, getAttributeMetaData, getPresentation, getResourceKey, getSystem, isBidiEnabled, isConnectionEstablished, removeActiveStatusListener, removePropertyChangeListener, removeResourceListener, removeVetoableChangeListener, setPresentation, setResourceKey, setSystem, toString
-
-
-
-
Field Detail
-
MAXIMUM_USERS
public static final java.lang.String MAXIMUM_USERS
Deprecated.Attribute ID for "maximum users". This identifies an Integer attribute, which represents the maximum number of users who can concurrently access this share. The value must be greater than or equal to zero, or -1, which means there is no limit to the number of users who can concurrently use this share.
The default is -1.- See Also:
- Constant Field Values
-
PATH
public static final java.lang.String PATH
Deprecated.Attribute ID for "path". This identifies a String attribute, which represents the path of a share.
The path name is the path in the integrated file system to be shared with the network. A forward slash, '/', is required as the first character. The maximum length is 512 characters.- See Also:
- Constant Field Values
-
PERMISSION
public static final java.lang.String PERMISSION
Deprecated.Attribute ID for "permission". This identifies an Integer attribute, which represents the permission for a share. Valid values are:PERMISSION_READ_ONLY
- Read-only permission.PERMISSION_READ_WRITE
- Read/write permission.
- See Also:
- Constant Field Values
-
PERMISSION_READ_ONLY
public static final java.lang.Integer PERMISSION_READ_ONLY
Deprecated.PERMISSION
attribute value indicating "read only" permission to a share.
-
PERMISSION_READ_WRITE
public static final java.lang.Integer PERMISSION_READ_WRITE
Deprecated.PERMISSION
attribute value indicating "read/write" permission to a share.
-
-
Constructor Detail
-
NetServerFileShare
public NetServerFileShare()
Deprecated.Constructs a NetServerFileShare object. The system and share name must be set before the object is used.
-
NetServerFileShare
public NetServerFileShare(AS400 system, java.lang.String name)
Deprecated.Constructs a NetServerFileShare object.- Parameters:
system
-name
- The name of the share.
-
-
Method Detail
-
add
public void add() throws ResourceException
Deprecated.Adds the file server share to the NetServer. This method fires a resourceCreated() ResourceEvent.
The system and share name be set before this method is called.
ThePATH
attribute must be set before this method is called.commitAttributeChanges
must not be called prior to this method.
This method requires *IOSYSCFG special authority on the system, or that the user own the integrated file system directory.
Note: This method is not supported prior to OS/400 V5R1.- Specified by:
add
in classNetServerShare
- Throws:
ResourceException
- If an error occurs.
-
commitAttributeChanges
protected void commitAttributeChanges(java.lang.Object[] attributeIDs, java.lang.Object[] values) throws ResourceException
Deprecated.Commits the specified attribute changes. This method fires an attributeChangesCommitted() ResourceEvent.
This method requires *IOSYSCFG special authority on the system.- Overrides:
commitAttributeChanges
in classNetServerShare
- Parameters:
attributeIDs
- The attribute IDs for the specified attribute changes.values
- The specified attribute changes- Throws:
ResourceException
- If an error occurs.- See Also:
- Subclass notes
-
establishConnection
protected void establishConnection() throws ResourceException
Deprecated.Establishes the connection to the system.The method is called by the resource framework automatically when the connection needs to be established.
- Specified by:
establishConnection
in classNetServerShare
- Throws:
ResourceException
- If an error occurs.
-
-