Serializablepublic class NetServerFileShare extends NetServerShare
ISeriesNetServerFileShare
class and may be removed in a future release.NetServer.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
and
setAttributeValue 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();
}
| Modifier and Type | Field | Description |
|---|---|---|
static String |
MAXIMUM_USERS |
Deprecated.
Attribute ID for "maximum users".
|
static String |
PATH |
Deprecated.
Attribute ID for "path".
|
static String |
PERMISSION |
Deprecated.
Attribute ID for "permission".
|
static Integer |
PERMISSION_READ_ONLY |
Deprecated.
PERMISSION attribute value indicating "read only" permission to a share. |
static Integer |
PERMISSION_READ_WRITE |
Deprecated.
PERMISSION attribute value indicating "read/write" permission to a share. |
DESCRIPTION, USER_COUNT| Constructor | Description |
|---|---|
NetServerFileShare() |
Deprecated.
Constructs a NetServerFileShare object.
|
NetServerFileShare(AS400 system,
String name) |
Deprecated.
Constructs a NetServerFileShare object.
|
| Modifier and Type | Method | Description |
|---|---|---|
void |
add() |
Deprecated.
Adds the file server share to the NetServer.
|
protected void |
commitAttributeChanges(Object[] attributeIDs,
Object[] values) |
Deprecated.
Commits the specified attribute changes.
|
protected void |
establishConnection() |
Deprecated.
Establishes the connection to the system.
|
freezeProperties, getAttributeUnchangedValue, getName, listConnections, refreshAttributeValues, remove, setNamecancelAttributeChanges, commitAttributeChanges, commitAttributeChanges, fireAttributeChangesCanceled, fireAttributeChangesCommitted, fireAttributeValueChanged, fireResourceCreated, fireResourceDeleted, getAttributeUnchangedValue, getAttributeValue, getAttributeValue, hasUncommittedAttributeChanges, initializeAttributeValue, setAttributeValue, setAttributeValueaddActiveStatusListener, addPropertyChangeListener, addResourceListener, addVetoableChangeListener, arePropertiesFrozen, equals, fireAttributeValuesRefreshed, fireBusy, fireIdle, firePropertyChange, fireVetoableChange, getAttributeMetaData, getAttributeMetaData, getPresentation, getResourceKey, getSystem, isBidiEnabled, isConnectionEstablished, removeActiveStatusListener, removePropertyChangeListener, removeResourceListener, removeVetoableChangeListener, setPresentation, setResourceKey, setSystem, toStringpublic static final String MAXIMUM_USERS
public static final String PATH
public static final String PERMISSION
PERMISSION_READ_ONLY - Read-only permission.
PERMISSION_READ_WRITE - Read/write permission.
public static final Integer PERMISSION_READ_ONLY
PERMISSION attribute value indicating "read only" permission to a share.public static final Integer PERMISSION_READ_WRITE
PERMISSION attribute value indicating "read/write" permission to a share.public NetServerFileShare()
public void add()
throws ResourceException
PATH attribute must be set before this method is called.
commitAttributeChanges must not be called prior to this method.
add in class NetServerShareResourceException - If an error occurs.protected void commitAttributeChanges(Object[] attributeIDs, Object[] values) throws ResourceException
commitAttributeChanges in class NetServerShareattributeIDs - The attribute IDs for the specified attribute changes.values - The specified attribute changesResourceException - If an error occurs.protected void establishConnection()
throws ResourceException
The method is called by the resource framework automatically when the connection needs to be established.
establishConnection in class NetServerShareResourceException - If an error occurs.Copyright © 2024. All rights reserved.