Merge pull request #19704 from owncloud/fix_17997

also detect files in a .part folder as part file
This commit is contained in:
Björn Schießle 2015-10-12 14:34:57 +02:00
commit 8a35034b4c
2 changed files with 27 additions and 0 deletions

View file

@ -408,6 +408,10 @@ class Scanner extends BasicEmitter {
if (pathinfo($file, PATHINFO_EXTENSION) === 'part') {
return true;
}
if (strpos($file, '.part/') !== false) {
return true;
}
return false;
}

View file

@ -284,4 +284,27 @@ class Scanner extends \Test\TestCase {
$cachedData = $this->cache->get('folder/bar.txt');
$this->assertEquals($newFolderId, $cachedData['parent']);
}
/**
* @dataProvider dataTestIsPartialFile
*
* @param string $path
* @param bool $expected
*/
public function testIsPartialFile($path, $expected) {
$this->assertSame($expected,
$this->scanner->isPartialFile($path)
);
}
public function dataTestIsPartialFile() {
return [
['foo.txt.part', true],
['/sub/folder/foo.txt.part', true],
['/sub/folder.part/foo.txt', true],
['foo.txt', false],
['/sub/folder/foo.txt', false],
];
}
}