# The Red Matrix: RedFile Class Reference

All Classes Namespaces Files Functions Variables Pages
RedFile Class Reference
Inheritance diagram for RedFile:

## Public Member Functions

| __construct ($name, $data, &$auth)
| getName ()
| Returns the name of the file. More...
| setName ($newName)
| Renames the file. More...
| put ($data)
| Updates the data of the file. More...
| get ()
| Returns the raw data. More...
| getETag ()
| Returns the ETag for a file. More...
| getContentType ()
| Returns the mime-type for a file. More...
| getSize ()
| Returns the size of the node, in bytes. More...
| getLastModified ()
| Returns the last modification time for the file, as a unix timestamp. More...
| delete ()
| Delete the file. More...

## Private Attributes

| $data
| $auth
| $name

## Detailed Description

RedFile class.

## Constructor & Destructor Documentation

RedFile::__construct | ( |  | $name,
|  |  | $data,
|  | & | $auth
| ) |  |

Sets up the node, expects a full path name.

Parameters

  string | $name |
  array | $data | from attach table
  | &$auth |

## Member Function Documentation

RedFile::delete | ( |  | ) |

Delete the file.

Exceptions

  DAV\Exception\Forbidden |

Returns
  void

RedFile::get | ( |  | ) |

Returns the raw data.

Returns
  string

RedFile::getContentType | ( |  | ) |

Returns the mime-type for a file.

If null is returned, we'll assume application/octet-stream

Returns
  mixed

RedFile::getETag | ( |  | ) |

Returns the ETag for a file.

An ETag is a unique identifier representing the current version of the file. If the file changes, the ETag MUST change. The ETag is an arbitrary string, but MUST be surrounded by double-quotes.

Return null if the ETag can not effectively be determined.

Returns
  mixed

RedFile::getLastModified | ( |  | ) |

Returns the last modification time for the file, as a unix timestamp.

Returns
  int last modification time in UNIX timestamp

RedFile::getName | ( |  | ) |

Returns the name of the file.

Returns
  string

RedFile::getSize | ( |  | ) |

Returns the size of the node, in bytes.

Returns
  int

RedFile::put | ( |  | $data | ) |

Updates the data of the file.

Parameters

  resource | $data |

Returns
  void

RedFile::setName | ( |  | $newName | ) |

Renames the file.

Exceptions

  DAV\Exception\Forbidden |

Parameters

  string | $name | The new name of the file.

Returns
  void

## Member Data Documentation

RedFile::$auth

private

Referenced by __construct().

RedFile::$data

private

Referenced by __construct(), and put().

RedFile::$name

private

Referenced by __construct().

The documentation for this class was generated from the following file:

- include/reddav.php