com.mucommander.file
Interface FilePermissions

All Superinterfaces:
PermissionBits
All Known Implementing Classes:
SimpleFilePermissions

public interface FilePermissions
extends PermissionBits

FilePermissions is an interface that represents the permissions of an AbstractFile. The actual permission values can be retrieved by the methods inherited from the PermissionBits interface. The permissions mask returned by getMask() allows to determine which permission bits are significant, i.e. should be taken into account. That way, certain AbstractFile implementations that have limited permissions support can set those supported permission bits while making it clear that other bits should be ignored, and not simply be considered as being disabled. For instance, a file implementation with support for the sole 'user' permissions (read/write/execute) will return a mask whose int value is 448 (700 octal).

This interface also defines constants for commonly used file permissions.

Author:
Maxence Bernard
See Also:
AbstractFile.getPermissions()

Field Summary
static FilePermissions DEFAULT_DIRECTORY_PERMISSIONS
          Default directory permissions used by AbstractFile.importPermissions(AbstractFile) for permission bits that are not available in the source: rwxr-xr-x (755 octal).
static FilePermissions DEFAULT_FILE_PERMISSIONS
          Default file permissions used by AbstractFile.importPermissions(AbstractFile) for permission bits that are not available in the source: rw-r--r-- (644 octal).
static FilePermissions EMPTY_FILE_PERMISSIONS
          Empty file permissions: read/write/execute permissions cleared for user/group/other (0), none of the permission bits are supported (mask is 0)
 
Fields inherited from interface com.mucommander.file.PermissionBits
EMPTY_PERMISSION_BITS, EMPTY_PERMISSION_INT, FULL_PERMISSION_BITS, FULL_PERMISSION_INT
 
Method Summary
 PermissionBits getMask()
          Returns the mask that indicates which permission bits are significant and should be taken into account.
 
Methods inherited from interface com.mucommander.file.PermissionBits
getBitValue, getIntValue
 

Field Detail

EMPTY_FILE_PERMISSIONS

static final FilePermissions EMPTY_FILE_PERMISSIONS
Empty file permissions: read/write/execute permissions cleared for user/group/other (0), none of the permission bits are supported (mask is 0)


DEFAULT_FILE_PERMISSIONS

static final FilePermissions DEFAULT_FILE_PERMISSIONS
Default file permissions used by AbstractFile.importPermissions(AbstractFile) for permission bits that are not available in the source: rw-r--r-- (644 octal). All of the permission bits are marked as supported.


DEFAULT_DIRECTORY_PERMISSIONS

static final FilePermissions DEFAULT_DIRECTORY_PERMISSIONS
Default directory permissions used by AbstractFile.importPermissions(AbstractFile) for permission bits that are not available in the source: rwxr-xr-x (755 octal). All of the permission bits are marked as supported.

Method Detail

getMask

PermissionBits getMask()
Returns the mask that indicates which permission bits are significant and should be taken into account. Permission bits that are unsupported have no meaning and their value should simply be ignored.

Returns:
the mask that indicates which permission bits are significant and should be taken into account.


This file is part of muCommander - Copyright (C) 2002-2008 Maxence Bernard