6 * The node class implements the method used by both the File and the Directory classes
10 * @copyright Copyright (C) 2007-2012 Rooftop Solutions. All rights reserved.
11 * @author Evert Pot (http://www.rooftopsolutions.nl/)
12 * @license http://code.google.com/p/sabredav/wiki/License Modified BSD License
14 abstract class Sabre_DAV_FS_Node implements Sabre_DAV_INode {
17 * The path to the current node
24 * Sets up the node, expects a full path name
28 public function __construct($path) {
37 * Returns the name of the node
41 public function getName() {
43 list(, $name) = Sabre_DAV_URLUtil::splitPath($this->path);
51 * @param string $name The new name
54 public function setName($name) {
56 list($parentPath, ) = Sabre_DAV_URLUtil::splitPath($this->path);
57 list(, $newName) = Sabre_DAV_URLUtil::splitPath($name);
59 $newPath = $parentPath . '/' . $newName;
60 rename($this->path,$newPath);
62 $this->path = $newPath;
69 * Returns the last modification time, as a unix timestamp
73 public function getLastModified() {
75 return filemtime($this->path);