diff options
author | Robin Appelman <icewind@owncloud.com> | 2014-01-13 14:28:49 +0100 |
---|---|---|
committer | Robin Appelman <icewind@owncloud.com> | 2014-01-13 14:28:49 +0100 |
commit | 617acbd6f9e93254c31987639cc4915dceb7c4c0 (patch) | |
tree | f23296b22fbd833809ebf1ca5598208a425c1c31 /lib/public | |
parent | 85e00ad35a63d2d728140f3ece685d79d7a6140c (diff) | |
download | nextcloud-server-617acbd6f9e93254c31987639cc4915dceb7c4c0.tar.gz nextcloud-server-617acbd6f9e93254c31987639cc4915dceb7c4c0.zip |
Add a FileInfo class which holds all info of a file and return that from getFileInfo, getDirectoryContent and search
Diffstat (limited to 'lib/public')
-rw-r--r-- | lib/public/files/fileinfo.php | 87 | ||||
-rw-r--r-- | lib/public/util.php | 2 |
2 files changed, 88 insertions, 1 deletions
diff --git a/lib/public/files/fileinfo.php b/lib/public/files/fileinfo.php new file mode 100644 index 00000000000..a11378c2ee5 --- /dev/null +++ b/lib/public/files/fileinfo.php @@ -0,0 +1,87 @@ +<?php +/** + * Created by PhpStorm. + * User: robin + * Date: 1/13/14 + * Time: 1:45 PM + */ +namespace OCP\Files; + +interface FileInfo extends \ArrayAccess, \JsonSerializable { + const TYPE_FILE = 'file'; + const TYPE_FOLDER = 'folder'; + + public function offsetSet($offset, $value); + + public function offsetGet($offset); + + public function offsetUnset($offset); + + public function offsetExists($offset); + + public function jsonSerialize(); + + /** + * @return string + */ + public function getEtag(); + + /** + * @return int + */ + public function getSize(); + + /** + * @return int + */ + public function getMtime(); + + /** + * @return string + */ + public function getName(); + + /** + * @return string + */ + public function getInternalPath(); + + /** + * @return string + */ + public function getPath(); + + /** + * @return string + */ + public function getMimetype(); + + /** + * @return \OCP\Files\Storage + */ + public function getStorage(); + + /** + * @return int + */ + public function getId(); + + /** + * @return string + */ + public function getMimePart(); + /** + * @return bool + */ + public function isEncrypted(); + + /** + * @return int + */ + public function getPermissions(); + + /** + * @return \OCP\Files\FileInfo::TYPE_FILE | \OCP\Files\FileInfo::TYPE_FOLDER + */ + public function getType(); +} diff --git a/lib/public/util.php b/lib/public/util.php index 8e85f9afc3f..9f945f0feac 100644 --- a/lib/public/util.php +++ b/lib/public/util.php @@ -117,7 +117,7 @@ class Util { /** * get l10n object * @param string $application - * @return OC_L10N + * @return \OC_L10N */ public static function getL10N( $application ) { return \OC_L10N::get( $application ); |