Example #1
0
 public function testContent()
 {
     $this->instance = $this->getExisting();
     $dir = OC::$SERVERROOT . '/tests/data';
     $textFile = $dir . '/lorem.txt';
     $this->assertEquals(file_get_contents($textFile), $this->instance->getFile('lorem.txt'));
     $tmpFile = OCP\Files::tmpFile('.txt');
     $this->instance->extractFile('lorem.txt', $tmpFile);
     $this->assertEquals(file_get_contents($textFile), file_get_contents($tmpFile));
 }
Example #2
0
 public function touch($path, $mtime = null)
 {
     if (is_null($mtime)) {
         $tmpFile = OCP\Files::tmpFile();
         $this->archive->extractFile($path, $tmpFile);
         $this->archive->addfile($path, $tmpFile);
     } else {
         return false;
         //not supported
     }
 }
Example #3
0
 private function toTmpFile($path)
 {
     $tmpFile = \OCP\Files::tmpFile();
     $this->archive->extractFile($path, $tmpFile);
     return $tmpFile;
 }
Example #4
0
 private function toTmpFile($path)
 {
     $tmpFile = OC_Helper::tmpFile($extension);
     $this->archive->extractFile($path, $tmpFile);
     return $tmpFile;
 }