* @return mixed directory contents if $list is true, file metadata if $list is
* false, null if the file doesn't exist or "false" if the operation failed
*/
- private function getMetaData($path, $list = false) {
+ private function getDropBoxMetaData($path, $list = false) {
$path = $this->root.$path;
if ( ! $list && isset($this->metaData[$path])) {
return $this->metaData[$path];
}
public function opendir($path) {
- $contents = $this->getMetaData($path, true);
+ $contents = $this->getDropBoxMetaData($path, true);
if ($contents !== false) {
$files = array();
foreach ($contents as $file) {
}
public function stat($path) {
- $metaData = $this->getMetaData($path);
+ $metaData = $this->getDropBoxMetaData($path);
if ($metaData) {
$stat['size'] = $metaData['bytes'];
$stat['atime'] = time();
if ($path == '' || $path == '/') {
return 'dir';
} else {
- $metaData = $this->getMetaData($path);
+ $metaData = $this->getDropBoxMetaData($path);
if ($metaData) {
if ($metaData['is_dir'] == 'true') {
return 'dir';
if ($path == '' || $path == '/') {
return true;
}
- if ($this->getMetaData($path)) {
+ if ($this->getDropBoxMetaData($path)) {
return true;
}
return false;
public function rename($path1, $path2) {
try {
// overwrite if target file exists and is not a directory
- $destMetaData = $this->getMetaData($path2);
+ $destMetaData = $this->getDropBoxMetaData($path2);
if (isset($destMetaData) && $destMetaData !== false && !$destMetaData['is_dir']) {
$this->unlink($path2);
}
if ($this->filetype($path) == 'dir') {
return 'httpd/unix-directory';
} else {
- $metaData = $this->getMetaData($path);
+ $metaData = $this->getDropBoxMetaData($path);
if ($metaData) {
return $metaData['mime_type'];
}