diff options
author | Robin Appelman <icewind@owncloud.com> | 2014-10-22 19:33:36 +0400 |
---|---|---|
committer | Robin Appelman <icewind@owncloud.com> | 2015-01-08 18:22:14 +0300 |
commit | 344606b2c80d0384364d0c691aedb45c7476df5c (patch) | |
tree | 23c35151d15e6108bdded068696c8052d8ef9ace /lib/public | |
parent | a5574e885c0b69c7f0c343564e9fc218f4c6697d (diff) |
Add \OC\TempManager to handle creating and cleaning temporary files
Conflicts:
lib/private/server.php
lib/public/iservercontainer.php
Diffstat (limited to 'lib/public')
-rw-r--r-- | lib/public/iservercontainer.php | 7 | ||||
-rw-r--r-- | lib/public/itempmanager.php | 38 |
2 files changed, 45 insertions, 0 deletions
diff --git a/lib/public/iservercontainer.php b/lib/public/iservercontainer.php index d1d6487d8cb..f9adc46c3d9 100644 --- a/lib/public/iservercontainer.php +++ b/lib/public/iservercontainer.php @@ -232,4 +232,11 @@ interface IServerContainer { * @return \OC\HTTPHelper */ function getHTTPHelper(); + + /** + * Get the manager for temporary files and folders + * + * @return \OCP\ITempManager + */ + function getTempManager(); } diff --git a/lib/public/itempmanager.php b/lib/public/itempmanager.php new file mode 100644 index 00000000000..ebd94978038 --- /dev/null +++ b/lib/public/itempmanager.php @@ -0,0 +1,38 @@ +<?php + +/** + * Copyright (c) 2014 Robin Appelman <icewind@owncloud.com> + * This file is licensed under the Affero General Public License version 3 or + * later. + * See the COPYING-README file. + */ + +namespace OCP; + +interface ITempManager { + /** + * Create a temporary file and return the path + * + * @param string $postFix + * @return string + */ + public function getTemporaryFile($postFix = ''); + + /** + * Create a temporary folder and return the path + * + * @param string $postFix + * @return string + */ + public function getTemporaryFolder($postFix = ''); + + /** + * Remove the temporary files and folders generated during this request + */ + public function clean(); + + /** + * Remove old temporary files and folders that were failed to be cleaned + */ + public function cleanOld(); +} |