3 * This file is part of vfsStream.
5 * For the full copyright and license information, please view the LICENSE
6 * file that was distributed with this source code.
8 * @package org\bovigo\vfs
10 namespace org\bovigo\vfs;
12 * Interface for stream contents.
14 interface vfsStreamContent
17 * stream content type: file
21 const TYPE_FILE = 0100000;
23 * stream content type: directory
27 const TYPE_DIR = 0040000;
29 * stream content type: symbolic link
33 #const TYPE_LINK = 0120000;
36 * stream content type: block
40 const TYPE_BLOCK = 0060000;
43 * returns the file name of the content
47 public function getName();
52 * @param string $newName
54 public function rename($newName);
57 * checks whether the container can be applied to given name
62 public function appliesTo($name);
65 * returns the type of the container
69 public function getType();
72 * returns size of content
76 public function size();
79 * sets the last modification time of the stream content
81 * @param int $filemtime
82 * @return vfsStreamContent
84 public function lastModified($filemtime);
87 * returns the last modification time of the stream content
91 public function filemtime();
94 * adds content to given container
96 * @param vfsStreamContainer $container
97 * @return vfsStreamContent
99 public function at(vfsStreamContainer $container);
102 * change file mode to given permissions
104 * @param int $permissions
105 * @return vfsStreamContent
107 public function chmod($permissions);
110 * returns permissions
114 public function getPermissions();
117 * checks whether content is readable
119 * @param int $user id of user to check for
120 * @param int $group id of group to check for
123 public function isReadable($user, $group);
126 * checks whether content is writable
128 * @param int $user id of user to check for
129 * @param int $group id of group to check for
132 public function isWritable($user, $group);
135 * checks whether content is executable
137 * @param int $user id of user to check for
138 * @param int $group id of group to check for
141 public function isExecutable($user, $group);
144 * change owner of file to given user
147 * @return vfsStreamContent
149 public function chown($user);
152 * checks whether file is owned by given user
157 public function isOwnedByUser($user);
160 * returns owner of file
164 public function getUser();
167 * change owner group of file to given group
170 * @return vfsStreamContent
172 public function chgrp($group);
175 * checks whether file is owned by group
180 public function isOwnedByGroup($group);
183 * returns owner group of file
187 public function getGroup();
192 * @param string $parentPath
193 * @internal only to be set by parent
196 public function setParentPath($parentPath);
199 * returns path to this content
204 public function path();
207 * returns complete vfsStream url for this content
212 public function url();