remove unused Storage->getLocalFolder
This commit is contained in:
parent
7dde2c773f
commit
fb76d7de69
|
@ -248,12 +248,6 @@ abstract class Common implements Storage, ILockingStorage {
|
||||||
return $this->getCachedFile($path);
|
return $this->getCachedFile($path);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getLocalFolder($path) {
|
|
||||||
$baseDir = \OC::$server->getTempManager()->getTemporaryFolder();
|
|
||||||
$this->addLocalFolder($path, $baseDir);
|
|
||||||
return $baseDir;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param string $path
|
* @param string $path
|
||||||
* @param string $target
|
* @param string $target
|
||||||
|
|
|
@ -376,17 +376,6 @@ class Availability extends Wrapper {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** {@inheritdoc} */
|
|
||||||
public function getLocalFolder($path) {
|
|
||||||
$this->checkAvailability();
|
|
||||||
try {
|
|
||||||
return parent::getLocalFolder($path);
|
|
||||||
} catch (\OCP\Files\StorageNotAvailableException $e) {
|
|
||||||
$this->setAvailability(false);
|
|
||||||
throw $e;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/** {@inheritdoc} */
|
/** {@inheritdoc} */
|
||||||
public function hasUpdated($path, $time) {
|
public function hasUpdated($path, $time) {
|
||||||
$this->checkAvailability();
|
$this->checkAvailability();
|
||||||
|
|
|
@ -352,17 +352,6 @@ class Jail extends Wrapper {
|
||||||
return $this->storage->getLocalFile($this->getSourcePath($path));
|
return $this->storage->getLocalFile($this->getSourcePath($path));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* get the path to a local version of the folder.
|
|
||||||
* The local version of the folder can be temporary and doesn't have to be persistent across requests
|
|
||||||
*
|
|
||||||
* @param string $path
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
public function getLocalFolder($path) {
|
|
||||||
return $this->storage->getLocalFolder($this->getSourcePath($path));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* check if a file or folder has been updated since $time
|
* check if a file or folder has been updated since $time
|
||||||
*
|
*
|
||||||
|
|
|
@ -353,17 +353,6 @@ class Wrapper implements \OC\Files\Storage\Storage, ILockingStorage {
|
||||||
return $this->storage->getLocalFile($path);
|
return $this->storage->getLocalFile($path);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* get the path to a local version of the folder.
|
|
||||||
* The local version of the folder can be temporary and doesn't have to be persistent across requests
|
|
||||||
*
|
|
||||||
* @param string $path
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
public function getLocalFolder($path) {
|
|
||||||
return $this->storage->getLocalFolder($path);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* check if a file or folder has been updated since $time
|
* check if a file or folder has been updated since $time
|
||||||
*
|
*
|
||||||
|
|
|
@ -330,15 +330,6 @@ interface Storage extends IStorage {
|
||||||
*/
|
*/
|
||||||
public function getLocalFile($path);
|
public function getLocalFile($path);
|
||||||
|
|
||||||
/**
|
|
||||||
* get the path to a local version of the folder.
|
|
||||||
* The local version of the folder can be temporary and doesn't have to be persistent across requests
|
|
||||||
*
|
|
||||||
* @param string $path
|
|
||||||
* @return string|false
|
|
||||||
* @since 6.0.0
|
|
||||||
*/
|
|
||||||
public function getLocalFolder($path);
|
|
||||||
/**
|
/**
|
||||||
* check if a file or folder has been updated since $time
|
* check if a file or folder has been updated since $time
|
||||||
*
|
*
|
||||||
|
|
|
@ -333,16 +333,6 @@ interface IStorage {
|
||||||
*/
|
*/
|
||||||
public function getLocalFile($path);
|
public function getLocalFile($path);
|
||||||
|
|
||||||
/**
|
|
||||||
* get the path to a local version of the folder.
|
|
||||||
* The local version of the folder can be temporary and doesn't have to be persistent across requests
|
|
||||||
*
|
|
||||||
* @param string $path
|
|
||||||
* @return string|false
|
|
||||||
* @since 9.0.0
|
|
||||||
*/
|
|
||||||
public function getLocalFolder($path);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* check if a file or folder has been updated since $time
|
* check if a file or folder has been updated since $time
|
||||||
*
|
*
|
||||||
|
|
|
@ -81,18 +81,6 @@ class Home extends Storage {
|
||||||
parent::tearDown();
|
parent::tearDown();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Tests that the root path matches the data dir
|
|
||||||
*/
|
|
||||||
public function testRoot() {
|
|
||||||
if (\OC_Util::runningOnWindows()) {
|
|
||||||
// Windows removes trailing slashes when returning paths
|
|
||||||
$this->assertEquals(rtrim($this->tmpDir, '/'), $this->instance->getLocalFolder(''));
|
|
||||||
} else {
|
|
||||||
$this->assertEquals($this->tmpDir, $this->instance->getLocalFolder(''));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tests that the home id is in the format home::user1
|
* Tests that the home id is in the format home::user1
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -262,9 +262,6 @@ abstract class Storage extends \Test\TestCase {
|
||||||
$this->instance->file_put_contents('/folder/bar.txt', 'asd');
|
$this->instance->file_put_contents('/folder/bar.txt', 'asd');
|
||||||
$this->instance->mkdir('/folder/recursive');
|
$this->instance->mkdir('/folder/recursive');
|
||||||
$this->instance->file_put_contents('/folder/recursive/file.txt', 'foo');
|
$this->instance->file_put_contents('/folder/recursive/file.txt', 'foo');
|
||||||
$localFolder = $this->instance->getLocalFolder('/folder');
|
|
||||||
|
|
||||||
$this->assertTrue(is_dir($localFolder));
|
|
||||||
|
|
||||||
// test below require to use instance->getLocalFile because the physical storage might be different
|
// test below require to use instance->getLocalFile because the physical storage might be different
|
||||||
$localFile = $this->instance->getLocalFile('/folder/lorem.txt');
|
$localFile = $this->instance->getLocalFile('/folder/lorem.txt');
|
||||||
|
|
Loading…
Reference in New Issue