summaryrefslogtreecommitdiffstats
path: root/apps/files_encryption
diff options
context:
space:
mode:
authorFrank Karlitschek <frank@owncloud.org>2012-05-02 12:54:31 +0200
committerFrank Karlitschek <frank@owncloud.org>2012-05-02 12:54:31 +0200
commit8c7f8546716ac77cdeaa134caf9fae22232ce213 (patch)
tree80c98f5aaf0274e5c38c3d55af9400a720552745 /apps/files_encryption
parentf1830866a3f20e50c3d409d3cdd508a98fc56377 (diff)
downloadnextcloud-server-8c7f8546716ac77cdeaa134caf9fae22232ce213.tar.gz
nextcloud-server-8c7f8546716ac77cdeaa134caf9fae22232ce213.zip
move all the files stuff into a files class
Diffstat (limited to 'apps/files_encryption')
-rwxr-xr-xapps/files_encryption/lib/proxy.php4
-rwxr-xr-xapps/files_encryption/tests/encryption.php4
-rwxr-xr-xapps/files_encryption/tests/stream.php4
3 files changed, 6 insertions, 6 deletions
diff --git a/apps/files_encryption/lib/proxy.php b/apps/files_encryption/lib/proxy.php
index cbe88adb5e4..ba357f23502 100755
--- a/apps/files_encryption/lib/proxy.php
+++ b/apps/files_encryption/lib/proxy.php
@@ -92,7 +92,7 @@ class OC_FileProxy_Encryption extends OC_FileProxy{
//first encrypt the target file so we don't end up with a half encrypted file
OCP\Util::writeLog('files_encryption','Decrypting '.$path.' before writing',OCP\Util::DEBUG);
$tmp=fopen('php://temp');
- OCP\Util::streamCopy($result,$tmp);
+ OCP\Files::streamCopy($result,$tmp);
fclose($result);
OC_Filesystem::file_put_contents($path,$tmp);
fclose($tmp);
@@ -104,7 +104,7 @@ class OC_FileProxy_Encryption extends OC_FileProxy{
public function postGetMimeType($path,$mime){
if(self::isEncrypted($path)){
- $mime=OCP\Util::getMimeType('crypt://'.$path,'w');
+ $mime=OCP\Files::getMimeType('crypt://'.$path,'w');
}
return $mime;
}
diff --git a/apps/files_encryption/tests/encryption.php b/apps/files_encryption/tests/encryption.php
index 24b3bbcaf40..00466cc671c 100755
--- a/apps/files_encryption/tests/encryption.php
+++ b/apps/files_encryption/tests/encryption.php
@@ -27,14 +27,14 @@ class Test_Encryption extends UnitTestCase {
$this->assertNotEqual($encrypted,$source);
$this->assertEqual($decrypted,$source);
- $tmpFileEncrypted=OCP\Util::tmpFile();
+ $tmpFileEncrypted=OCP\Files::tmpFile();
OC_Crypt::encryptfile($file,$tmpFileEncrypted,$key);
$encrypted=file_get_contents($tmpFileEncrypted);
$decrypted=OC_Crypt::blockDecrypt($encrypted,$key);
$this->assertNotEqual($encrypted,$source);
$this->assertEqual($decrypted,$source);
- $tmpFileDecrypted=OCP\Util::tmpFile();
+ $tmpFileDecrypted=OCP\Files::tmpFile();
OC_Crypt::decryptfile($tmpFileEncrypted,$tmpFileDecrypted,$key);
$decrypted=file_get_contents($tmpFileDecrypted);
$this->assertEqual($decrypted,$source);
diff --git a/apps/files_encryption/tests/stream.php b/apps/files_encryption/tests/stream.php
index 225e82c99e8..b23805d60b0 100755
--- a/apps/files_encryption/tests/stream.php
+++ b/apps/files_encryption/tests/stream.php
@@ -22,7 +22,7 @@ class Test_CryptStream extends UnitTestCase {
$file=OC::$SERVERROOT.'/3rdparty/MDB2.php';
$source=fopen($file,'r');
$target=$this->getStream('test2','w');
- OCP\Util::streamCopy($source,$target);
+ OCP\Files::streamCopy($source,$target);
fclose($target);
fclose($source);
@@ -44,7 +44,7 @@ class Test_CryptStream extends UnitTestCase {
$id=uniqid();
}
if(!isset($this->tmpFiles[$id])){
- $file=OCP\Util::tmpFile();
+ $file=OCP\Files::tmpFile();
$this->tmpFiles[$id]=$file;
}else{
$file=$this->tmpFiles[$id];