[TASK] Calculated hash of File object is never used
[Packages/TYPO3.CMS.git] / typo3 / sysext / core / Classes / Resource / File.php
index d3832ac..9d99675 100644 (file)
@@ -150,6 +150,18 @@ class File extends AbstractFile {
                return $this->getStorage()->getFileContents($this);
        }
 
+       /**
+        * Gets SHA1 hash.
+        *
+        * @return string
+        */
+       public function getSha1() {
+               if (empty($this->properties['sha1'])) {
+                       $this->properties['sha1'] = parent::getSha1();
+               }
+               return $this->properties['sha1'];
+       }
+
        /**
         * Replace the current file contents with the given string
         *