localFSRoot = Olio::$config['localfsRoot']; } function getRootDir() { return $this->localFSRoot; } function create($filename, $replication_factor='1', $overwrite = 'true') { $newfilename = $this->getNewFileName($filename); if ($newfilename == $filename) { return true; } if ($overwrite) { return copy($filename, $newfilename); } else { if (file_exists($newfilename)) { return false; } else { return copy($filename, $newfilename); } } } function getNewFileName($oldfilename) { return $this->localFSRoot . '/' . basename($oldfilename); } function getPaths($filename) { return array(0 => $this->localFSRoot . '/' . $filename); } /* return true or false */ function delete($filename) { return unlink($this->getNewFileName($filename)); } /* return true or false */ function exists($filename) { return file_exists($this->getNewFileName($filename)); } function open($filename) { return file_get_contents($this->getNewFileName($filename)); } } ?>