org.eclipse.rse.services.files
Class HostFilePermissions
java.lang.Object
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
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
|
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
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()
Copyright (c) IBM Corporation and others 2000, 2008. All Rights Reserved.