// written by Sunita Kanchinadam. // This class is derived from Node class. // It implements the hasWritePermissions() and GetTotalSize() abstract // methods from the Node class. import DuVisitor; import Node; public class File extends Node { // constructor File(String name) { setName(name); setSize(10); } /******************************************************************/ // method : hasWritePermissions // parameters : void // return value : boolean // description : Checks if the user has permission to access this // directory.Presently, it returns true in all cases // but, in future, it is expected to check if the user // logged in (that will be a global public member from // OS class) has permissions.Permissions should be // a private member of the Node class of type Byte. /******************************************************************/ public boolean hasWritePermissions() { return(true); } /******************************************************************/ // method : GetTotalSize // parameters : String // return value : integer // description : returns the total size of the File /******************************************************************/ public int GetTotalSize(String option) { return (this.getSize()); } }