diff options
Diffstat (limited to 'lib/private/Archive/TAR.php')
-rw-r--r-- | lib/private/Archive/TAR.php | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/lib/private/Archive/TAR.php b/lib/private/Archive/TAR.php index 07ccd09f399..e6f7ad2b998 100644 --- a/lib/private/Archive/TAR.php +++ b/lib/private/Archive/TAR.php @@ -52,7 +52,7 @@ class TAR extends Archive { /** * @param string $source */ - function __construct($source) { + public function __construct($source) { $types = array(null, 'gz', 'bz2'); $this->path = $source; $this->tar = new \Archive_Tar($source, $types[self::getTarType($source)]); @@ -90,7 +90,7 @@ class TAR extends Archive { * @param string $path * @return bool */ - function addFolder($path) { + public function addFolder($path) { $tmpBase = \OC::$server->getTempManager()->getTemporaryFolder(); if (substr($path, -1, 1) != '/') { $path .= '/'; @@ -120,7 +120,7 @@ class TAR extends Archive { * @param string $source either a local file or string data * @return bool */ - function addFile($path, $source = '') { + public function addFile($path, $source = '') { if ($this->fileExists($path)) { $this->remove($path); } @@ -140,7 +140,7 @@ class TAR extends Archive { * @param string $dest * @return bool */ - function rename($source, $dest) { + public function rename($source, $dest) { //no proper way to delete, rename entire archive, rename file and remake archive $tmp = \OCP\Files::tmpFolder(); $this->tar->extract($tmp); @@ -180,7 +180,7 @@ class TAR extends Archive { * @param string $path * @return int */ - function filesize($path) { + public function filesize($path) { $stat = $this->getHeader($path); return $stat['size']; } @@ -191,7 +191,7 @@ class TAR extends Archive { * @param string $path * @return int */ - function mtime($path) { + public function mtime($path) { $stat = $this->getHeader($path); return $stat['mtime']; } @@ -202,7 +202,7 @@ class TAR extends Archive { * @param string $path * @return array */ - function getFolder($path) { + public function getFolder($path) { $files = $this->getFiles(); $folderContent = array(); $pathLength = strlen($path); @@ -228,7 +228,7 @@ class TAR extends Archive { * * @return array */ - function getFiles() { + public function getFiles() { if ($this->fileList) { return $this->fileList; } @@ -249,7 +249,7 @@ class TAR extends Archive { * @param string $path * @return string */ - function getFile($path) { + public function getFile($path) { return $this->tar->extractInString($path); } @@ -260,7 +260,7 @@ class TAR extends Archive { * @param string $dest * @return bool */ - function extractFile($path, $dest) { + public function extractFile($path, $dest) { $tmp = \OCP\Files::tmpFolder(); if (!$this->fileExists($path)) { return false; @@ -283,7 +283,7 @@ class TAR extends Archive { * @param string $dest * @return bool */ - function extract($dest) { + public function extract($dest) { return $this->tar->extract($dest); } @@ -293,7 +293,7 @@ class TAR extends Archive { * @param string $path * @return bool */ - function fileExists($path) { + public function fileExists($path) { $files = $this->getFiles(); if ((array_search($path, $files) !== false) or (array_search($path . '/', $files) !== false)) { return true; @@ -322,7 +322,7 @@ class TAR extends Archive { * @param string $path * @return bool */ - function remove($path) { + public function remove($path) { if (!$this->fileExists($path)) { return false; } @@ -346,7 +346,7 @@ class TAR extends Archive { * @param string $mode * @return resource */ - function getStream($path, $mode) { + public function getStream($path, $mode) { if (strrpos($path, '.') !== false) { $ext = substr($path, strrpos($path, '.')); } else { @@ -371,7 +371,7 @@ class TAR extends Archive { /** * write back temporary files */ - function writeBack($tmpFile, $path) { + public function writeBack($tmpFile, $path) { $this->addFile($path, $tmpFile); unlink($tmpFile); } |