diff --git a/apps/files_external/lib/Lib/Storage/SFTP.php b/apps/files_external/lib/Lib/Storage/SFTP.php index e46f60d0be4..e811bc3728f 100644 --- a/apps/files_external/lib/Lib/Storage/SFTP.php +++ b/apps/files_external/lib/Lib/Storage/SFTP.php @@ -215,7 +215,7 @@ class SFTP extends \OC\Files\Storage\Common { */ private function hostKeysPath() { try { - $storage_view = \OCP\Files::getStorage('files_external'); + $storage_view = \OC_App::getStorage('files_external'); if ($storage_view) { return \OC::$server->getConfig()->getSystemValue('datadirectory', \OC::$SERVERROOT . '/data') . $storage_view->getAbsolutePath('') . diff --git a/apps/files_sharing/lib/External/Manager.php b/apps/files_sharing/lib/External/Manager.php index 68bc6801e46..dcf0e404546 100644 --- a/apps/files_sharing/lib/External/Manager.php +++ b/apps/files_sharing/lib/External/Manager.php @@ -42,7 +42,6 @@ use OCP\DB\QueryBuilder\IQueryBuilder; use OCP\EventDispatcher\IEventDispatcher; use OCP\Federation\ICloudFederationFactory; use OCP\Federation\ICloudFederationProviderManager; -use OCP\Files; use OCP\Files\NotFoundException; use OCP\Files\Storage\IStorageFactory; use OCP\Http\Client\IClientService; @@ -182,7 +181,7 @@ class Manager { return null; } - $mountPoint = Files::buildNotExistingFileName('/', $name); + $mountPoint = \OC_Helper::buildNotExistingFileName('/', $name); $mountPoint = Filesystem::normalizePath('/' . $mountPoint); $hash = md5($mountPoint); @@ -314,7 +313,7 @@ class Manager { if ($share) { \OC_Util::setupFS($this->uid); $shareFolder = Helper::getShareFolder(null, $this->uid); - $mountPoint = Files::buildNotExistingFileName($shareFolder, $share['name']); + $mountPoint = \OC_Helper::buildNotExistingFileName($shareFolder, $share['name']); $mountPoint = Filesystem::normalizePath($mountPoint); $hash = md5($mountPoint); $userShareAccepted = false; diff --git a/lib/composer/composer/autoload_classmap.php b/lib/composer/composer/autoload_classmap.php index 08a871e8466..b558359febd 100644 --- a/lib/composer/composer/autoload_classmap.php +++ b/lib/composer/composer/autoload_classmap.php @@ -252,7 +252,6 @@ return array( 'OCP\\Federation\\ICloudFederationShare' => $baseDir . '/lib/public/Federation/ICloudFederationShare.php', 'OCP\\Federation\\ICloudId' => $baseDir . '/lib/public/Federation/ICloudId.php', 'OCP\\Federation\\ICloudIdManager' => $baseDir . '/lib/public/Federation/ICloudIdManager.php', - 'OCP\\Files' => $baseDir . '/lib/public/Files.php', 'OCP\\Files\\AlreadyExistsException' => $baseDir . '/lib/public/Files/AlreadyExistsException.php', 'OCP\\Files\\AppData\\IAppDataFactory' => $baseDir . '/lib/public/Files/AppData/IAppDataFactory.php', 'OCP\\Files\\Cache\\AbstractCacheEvent' => $baseDir . '/lib/public/Files/Cache/AbstractCacheEvent.php', diff --git a/lib/composer/composer/autoload_static.php b/lib/composer/composer/autoload_static.php index eec226c9a6e..8ba60e667a6 100644 --- a/lib/composer/composer/autoload_static.php +++ b/lib/composer/composer/autoload_static.php @@ -285,7 +285,6 @@ class ComposerStaticInit749170dad3f5e7f9ca158f5a9f04f6a2 'OCP\\Federation\\ICloudFederationShare' => __DIR__ . '/../../..' . '/lib/public/Federation/ICloudFederationShare.php', 'OCP\\Federation\\ICloudId' => __DIR__ . '/../../..' . '/lib/public/Federation/ICloudId.php', 'OCP\\Federation\\ICloudIdManager' => __DIR__ . '/../../..' . '/lib/public/Federation/ICloudIdManager.php', - 'OCP\\Files' => __DIR__ . '/../../..' . '/lib/public/Files.php', 'OCP\\Files\\AlreadyExistsException' => __DIR__ . '/../../..' . '/lib/public/Files/AlreadyExistsException.php', 'OCP\\Files\\AppData\\IAppDataFactory' => __DIR__ . '/../../..' . '/lib/public/Files/AppData/IAppDataFactory.php', 'OCP\\Files\\Cache\\AbstractCacheEvent' => __DIR__ . '/../../..' . '/lib/public/Files/Cache/AbstractCacheEvent.php', diff --git a/lib/private/Archive/TAR.php b/lib/private/Archive/TAR.php index 79c09cbe9e2..b76048c1a15 100644 --- a/lib/private/Archive/TAR.php +++ b/lib/private/Archive/TAR.php @@ -255,7 +255,7 @@ class TAR extends Archive { if ($success) { rename($tmp . $path, $dest); } - \OCP\Files::rmdirr($tmp); + \OC_Helper::rmdirr($tmp); return $success; } @@ -301,7 +301,7 @@ class TAR extends Archive { //no proper way to delete, extract entire archive, delete file and remake archive $tmp = \OC::$server->getTempManager()->getTemporaryFolder(); $this->tar->extract($tmp); - \OCP\Files::rmdirr($tmp . $path); + \OC_Helper::rmdirr($tmp . $path); $this->tar = null; unlink($this->path); $this->reopen(); diff --git a/lib/public/Files.php b/lib/public/Files.php deleted file mode 100644 index c078f57b2c3..00000000000 --- a/lib/public/Files.php +++ /dev/null @@ -1,114 +0,0 @@ - - * @author Björn Schießle - * @author Christoph Wurst - * @author Frank Karlitschek - * @author Georg Ehrke - * @author Joas Schilling - * @author Jörn Friedrich Dreyer - * @author Morris Jobke - * @author Robin Appelman - * @author Roeland Jago Douma - * @author Stefan Weil - * @author Thomas Müller - * - * @license AGPL-3.0 - * - * This code is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License, version 3, - * as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License, version 3, - * along with this program. If not, see - * - */ -// use OCP namespace for all classes that are considered public. -// This means that they should be used by apps instead of the internal ownCloud classes - -namespace OCP; - -/** - * This class provides access to the internal filesystem abstraction layer. Use - * this class exlusively if you want to access files - * @since 5.0.0 - * @deprecated 14.0.0 - */ -class Files { - /** - * Recusive deletion of folders - * @return bool - * @since 5.0.0 - * @deprecated 14.0.0 - */ - public static function rmdirr($dir) { - return \OC_Helper::rmdirr($dir); - } - - /** - * Get the mimetype form a local file - * @param string $path - * @return string - * does NOT work for ownClouds filesystem, use OC_FileSystem::getMimeType instead - * @since 5.0.0 - * @deprecated 14.0.0 - */ - public static function getMimeType($path) { - return \OC::$server->getMimeTypeDetector()->detect($path); - } - - /** - * Search for files by mimetype - * @param string $mimetype - * @return array - * @since 6.0.0 - * @deprecated 14.0.0 - */ - public static function searchByMime($mimetype) { - return \OC\Files\Filesystem::searchByMime($mimetype); - } - - /** - * Copy the contents of one stream to another - * @param resource $source - * @param resource $target - * @return int the number of bytes copied - * @since 5.0.0 - * @deprecated 14.0.0 - */ - public static function streamCopy($source, $target) { - [$count, ] = \OC_Helper::streamCopy($source, $target); - return $count; - } - - /** - * Adds a suffix to the name in case the file exists - * @param string $path - * @param string $filename - * @return string - * @since 5.0.0 - * @deprecated 14.0.0 use getNonExistingName of the OCP\Files\Folder object - */ - public static function buildNotExistingFileName($path, $filename) { - return \OC_Helper::buildNotExistingFileName($path, $filename); - } - - /** - * Gets the Storage for an app - creates the needed folder if they are not - * existent - * @param string $app - * @return \OC\Files\View - * @since 5.0.0 - * @deprecated 14.0.0 use IAppData instead - */ - public static function getStorage($app) { - return \OC_App::getStorage($app); - } -} diff --git a/tests/lib/Archive/TestBase.php b/tests/lib/Archive/TestBase.php index a816cd97710..42340674fc2 100644 --- a/tests/lib/Archive/TestBase.php +++ b/tests/lib/Archive/TestBase.php @@ -91,7 +91,7 @@ abstract class TestBase extends \Test\TestCase { $this->instance = $this->getNew(); $fh = $this->instance->getStream('lorem.txt', 'w'); $source = fopen($dir.'/lorem.txt', 'r'); - \OCP\Files::streamCopy($source, $fh); + \OC_Helper::streamCopy($source, $fh); fclose($source); fclose($fh); $this->assertTrue($this->instance->fileExists('lorem.txt')); @@ -117,7 +117,7 @@ abstract class TestBase extends \Test\TestCase { $this->assertEquals(true, file_exists($tmpDir.'dir/lorem.txt')); $this->assertEquals(true, file_exists($tmpDir.'logo-wide.png')); $this->assertEquals(file_get_contents($dir.'/lorem.txt'), file_get_contents($tmpDir.'lorem.txt')); - \OCP\Files::rmdirr($tmpDir); + \OC_Helper::rmdirr($tmpDir); } public function testMoveRemove() { $dir = \OC::$SERVERROOT.'/tests/data'; diff --git a/tests/lib/UtilTest.php b/tests/lib/UtilTest.php index 568f535e557..f727b5db0ac 100644 --- a/tests/lib/UtilTest.php +++ b/tests/lib/UtilTest.php @@ -208,13 +208,13 @@ class UtilTest extends \Test\TestCase { touch($dataDir . '/.ocdata'); $errors = \OC_Util::checkDataDirectoryValidity($dataDir); $this->assertEmpty($errors); - \OCP\Files::rmdirr($dataDir); + \OC_Helper::rmdirr($dataDir); $dataDir = \OC::$server->getTempManager()->getTemporaryFolder(); // no touch $errors = \OC_Util::checkDataDirectoryValidity($dataDir); $this->assertNotEmpty($errors); - \OCP\Files::rmdirr($dataDir); + \OC_Helper::rmdirr($dataDir); $errors = \OC_Util::checkDataDirectoryValidity('relative/path'); $this->assertNotEmpty($errors);