com.ibm.as400.access

Class NetServerFileShare

  • All Implemented Interfaces:
    java.io.Serializable

    Deprecated. 
    This class has been replaced by the ISeriesNetServerFileShare 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 by 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();
     }
    
    See Also:
    Serialized Form
    • 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: The default is PERMISSION_READ_WRITE.
        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.
        The PATH 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 class NetServerShare
        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 class NetServerShare
        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 class NetServerShare
        Throws:
        ResourceException - If an error occurs.