FileAttributes

Overview | Package | Class | Use | Tree | Deprecated | Index | Help

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.dvb.io.persistent
Class FileAttributes

    java.lang.Object
      org.dvb.io.persistent.FileAttributes

    public class FileAttributes

extends Object

This class encapsulates the attributes of a file stored in persistent storage. The default attributes for a file are low priority, owner read / write only permissions and null expiration date.

Field Summary
`static int` | `PRIORITY_HIGH` Value for use as a file priority.
`static int` | `PRIORITY_LOW` Value for use as a file priority.
`static int` | `PRIORITY_MEDIUM` Value for use as a file priority.

Method Summary
`Date` | `getExpirationDate()` Returns the expiration date.
`static FileAttributes` | `getFileAttributes(File f)` Get the attributes of a file.
`FileAccessPermissions` | `getPermissions()` Returns the file access permissions
`int` | `getPriority()` Returns the priority to use in persistent storage
`void` | `setExpirationDate(Date d)` Sets the expiration date.
`static void` | `setFileAttributes(FileAttributes p, File f)` Associate a set of file attributes with a file.
`void` | `setPermissions(FileAccessPermissions p)` Sets the file access permissions.
`void` | `setPriority(int priority)` Sets the priority to use in persistent storage

Methods inherited from class java.lang.Object
`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### PRIORITY_LOW

    public static final int PRIORITY_LOW

  Value for use as a file priority.

  See Also:
    Constant Field Values

### PRIORITY_MEDIUM

    public static final int PRIORITY_MEDIUM

  Value for use as a file priority.

  See Also:
    Constant Field Values

### PRIORITY_HIGH

    public static final int PRIORITY_HIGH

  Value for use as a file priority.

  See Also:
    Constant Field Values

Method Detail

### getExpirationDate

    public Date getExpirationDate()

  Returns the expiration date. It will return the value used by the platform, which need not be the same as the value set.

  Returns:
    the expiration date

### setExpirationDate

    public void setExpirationDate(Date d)

  Sets the expiration date. This field is a hint to the platform to identify the date after which a file is no longer useful as percieved by the application. The platform may choose to use a different date than the one given as a parameter.

  Parameters:
    `d` - the expiration date

### getPermissions

    public FileAccessPermissions getPermissions()

  Returns the file access permissions

  Returns:
    the file access permissions

### setPermissions

    public void setPermissions(FileAccessPermissions p)

  Sets the file access permissions.

  Parameters:
    `p` - the file access permissions

### getPriority

    public int getPriority()

  Returns the priority to use in persistent storage

  Returns:
    the priority

### setPriority

    public void setPriority(int priority)

  Sets the priority to use in persistent storage

  Parameters:
    `priority` - the priority to set

### setFileAttributes

    public static void setFileAttributes(FileAttributes p,
                                         File f)
                                  throws IOException

  Associate a set of file attributes with a file.

  Parameters:
    `p` - the file attributes to use
    `f` - the file to use
  Throws:
    `SecurityException` - if the application is either denied access to the file or directories needed to reach the file by security policy or is not authorised to modify the attributes of the file.
    `IOException` - if access to the file fails due to an IO error or if the file reference is not to a valid location in persistent storage

### getFileAttributes

    public static FileAttributes getFileAttributes(File f)
                                            throws IOException

  Get the attributes of a file.

  Parameters:
    `f` - the file to use
  Returns:
    a copy of the attributes of a file
  Throws:
    `SecurityException` - if the application is denied access to the file or to directories needed to reach the file by security policy
    `IOException` - if access to the file fails due to an IO error or if the file reference is not to a valid location in persistent storage

Overview | Package | Class | Use | Tree | Deprecated | Index | Help

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD