public function __construct($arguments)
 {
     $this->datadir = $arguments['datadir'];
     if (OC_Share::getItemsInFolder($this->datadir)) {
         if (!OC_Filesystem::is_dir($this->datadir)) {
             OC_Filesystem::mkdir($this->datadir);
         }
     } else {
         if (OC_Filesystem::is_dir($this->datadir)) {
             OC_Filesystem::rmdir($this->datadir);
         }
     }
     $this->datadir .= "/";
 }
Ejemplo n.º 2
0
 /**
  * Deletes all files in this directory, and then itself
  *
  * @return void
  */
 public function delete()
 {
     if ($this->path != "/Shared") {
         foreach ($this->getChildren() as $child) {
             $child->delete();
         }
         OC_Filesystem::rmdir($this->path);
     }
 }