Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 

RSE
Release 3.0

org.eclipse.rse.services.files
Class HostFilePermissions

java.lang.Object
  extended by 
org.eclipse.rse.services.files.HostFilePermissions
All Implemented Interfaces:
Cloneable, IHostFilePermissions
Direct Known Subclasses:
PendingHostFilePermissions

public class HostFilePermissions
extends Object
implements IHostFilePermissions, Cloneable

Default implementation of "Universal" UNIX kind of IHostFilePermissions.

Since:
3.0

Field Summary
 
Fields inherited from interface org.eclipse.rse.services.files. IHostFilePermissions
PERM_ANY_EXECUTE, PERM_ANY_READ, PERM_ANY_WRITE, PERM_GROUP_EXECUTE, PERM_GROUP_READ, PERM_GROUP_WRITE, PERM_OTHER_EXECUTE, PERM_OTHER_READ, PERM_OTHER_WRITE, PERM_USER_EXECUTE, PERM_USER_READ, PERM_USER_WRITE
 
Constructor Summary
HostFilePermissions ()
          Constructor without any initial values.
HostFilePermissions (int initialPermissions, String user, String group)
          Constructor that takes the initial permissions as a bitmask
HostFilePermissions ( String alphaPermissions, String user, String group)
          Constructor that takes the initial permissions in rwxrwxrwx form
 
Method Summary
  Object clone ()
          Creates and returns a copy of this object, as specified by the Object.clone() contract.
  String getGroupOwner ()
          returns the group owner of the file
 boolean getPermission (int permission)
          Test if any of the permission bits from the bitmask are set.
 int getPermissionBits ()
          Get the set of permission bits.
  String getUserOwner ()
          returns the user owner of the file
 void setGroupOwner ( String group)
          Sets the group owner attribute
 void setPermission (int permission, boolean value)
          Set or reset all the permission bits from the given bitmask.
 void setPermissionBits (int bits)
          Set the permission bits
 void setUserOwner ( String user)
          Sets the user owner attribute
  String toAlphaString ()
          return permissions in rwxrwxrwx form
  String toString ()
           
 
Methods inherited from class java.lang. Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

HostFilePermissions

public HostFilePermissions()
Constructor without any initial values. Users of this need to set fields as appropriate


HostFilePermissions

public HostFilePermissions(
String alphaPermissions,
                           
String user,
                           
String group)
Constructor that takes the initial permissions in rwxrwxrwx form

Parameters:
alphaPermissions - the initial permissions in alpha form

HostFilePermissions

public HostFilePermissions(int initialPermissions,
                           
String user,
                           
String group)
Constructor that takes the initial permissions as a bitmask

Parameters:
initialPermissions - the initial permissions bitmask
Method Detail

setPermission

public void setPermission(int permission,
                          boolean value)
Description copied from interface: IHostFilePermissions
Set or reset all the permission bits from the given bitmask.

Specified by:
setPermission in interface IHostFilePermissions
Parameters:
permission - the permission(s) bits to modify
value - whether to turn on off of the permission(s) Example: setPermission(PERM_USER_WRITE | PERM_GROUP_WRITE, true);

getPermission

public boolean getPermission(int permission)
Description copied from interface: IHostFilePermissions
Test if any of the permission bits from the bitmask are set.

Specified by:
getPermission in interface IHostFilePermissions
Parameters:
permission - the permission(s) to check for
Returns:
true if one of the permission bits is set Example: getPermission(PERM_USER_WRITE | PERM_GROUP_WRITE)

getPermissionBits

public int getPermissionBits()
Description copied from interface: IHostFilePermissions
Get the set of permission bits.

Specified by:
getPermissionBits in interface IHostFilePermissions
Returns:
set of permission bits

setPermissionBits

public void setPermissionBits(int bits)
Description copied from interface: IHostFilePermissions
Set the permission bits

Specified by:
setPermissionBits in interface IHostFilePermissions
Parameters:
bits - the set of permission bits

toString

public 
String toString()
Overrides:
toString in class Object

toAlphaString

public 
String toAlphaString()
return permissions in rwxrwxrwx form

Specified by:
toAlphaString in interface IHostFilePermissions

getGroupOwner

public 
String getGroupOwner()
Description copied from interface: IHostFilePermissions
returns the group owner of the file

Specified by:
getGroupOwner in interface IHostFilePermissions
Returns:
the group owner

getUserOwner

public 
String getUserOwner()
Description copied from interface: IHostFilePermissions
returns the user owner of the file

Specified by:
getUserOwner in interface IHostFilePermissions
Returns:
the user owner

setGroupOwner

public void setGroupOwner(
String group)
Description copied from interface: IHostFilePermissions
Sets the group owner attribute

Specified by:
setGroupOwner in interface IHostFilePermissions
Parameters:
group - the group owner attribute

setUserOwner

public void setUserOwner(
String user)
Description copied from interface: IHostFilePermissions
Sets the user owner attribute

Specified by:
setUserOwner in interface IHostFilePermissions
Parameters:
user - the user owner attribute

clone

public 
Object clone()
             throws 
CloneNotSupportedException
Description copied from interface: IHostFilePermissions
Creates and returns a copy of this object, as specified by the Object.clone() contract. Each implementer of the IHostFilePermission API must properly implement this method and implement the Cloneable interface.

Specified by:
clone in interface IHostFilePermissions
Overrides:
clone in class Object
Returns:
the cloned object
Throws:
CloneNotSupportedException - if an instance cannot be cloned for any reason, e.g. because its state contains complex objects that cannot be cloned.
See Also:
Object.clone()

RSE
Release 3.0

Copyright (c) IBM Corporation and others 2000, 2008. All Rights Reserved.

 
 
  Published under the terms of the Eclipse Public License Version 1.0 ("EPL") Design by Interspire