2 namespace TYPO3\CMS\Core\Resource;
111 return array_key_exists($key, $this->properties);
123 return $this->properties[$key];
156 return $this->properties[
'identifier_hash'];
189 if ($this->deleted) {
190 throw new \RuntimeException(
'File has been deleted.', 1329821480);
192 return $this->properties[
'size'] ?: array_pop($this->
getStorage()->getFileInfoByIdentifier($this->
getIdentifier(), array(
'size')));
213 if ($this->deleted) {
214 throw new \RuntimeException(
'File has been deleted.', 1329821481);
216 return $this->
getStorage()->hashFile($this,
'sha1');
227 if ($this->deleted) {
228 throw new \RuntimeException(
'File has been deleted.', 1329821487);
241 if ($this->deleted) {
242 throw new \RuntimeException(
'File has been deleted.', 1329821488);
256 $extension = strtolower($pathinfo[
'extension']);
268 return $this->properties[
'mime_type'] ?: array_pop($this->
getStorage()->getFileInfoByIdentifier($this->
getIdentifier(), array(
'mimetype')));
289 if (!$this->properties[
'type']) {
291 list($fileType) = explode(
'/', $mimeType);
292 switch (strtolower($fileType)) {
294 $this->properties[
'type'] = self::FILETYPE_TEXT;
297 $this->properties[
'type'] = self::FILETYPE_IMAGE;
300 $this->properties[
'type'] = self::FILETYPE_AUDIO;
303 $this->properties[
'type'] = self::FILETYPE_VIDEO;
308 $this->properties[
'type'] = self::FILETYPE_APPLICATION;
311 $this->properties[
'type'] = self::FILETYPE_UNKNOWN;
314 return (
int)$this->properties[
'type'];
328 if ($this->deleted) {
329 throw new \RuntimeException(
'File has been deleted.', 1329821479);
331 return $this->
getStorage()->getFileContents($this);
344 if ($this->deleted) {
345 throw new \RuntimeException(
'File has been deleted.', 1329821478);
347 $this->
getStorage()->setFileContents($this, $contents);
363 if ($this->storage === null) {
364 throw new \RuntimeException(
'You\'re using fileObjects without a storage.', 1381570091);
378 if ($this->deleted) {
395 $this->properties[
'storage'] = $storage->
getUid();
421 $combinedIdentifier = $this->properties[
'storage'] .
':' . $this->
getIdentifier();
425 return $combinedIdentifier;
433 public function delete()
436 return $this->
getStorage()->deleteFile($this);
447 $this->deleted =
true;
470 if ($this->deleted) {
471 throw new \RuntimeException(
'File has been deleted.', 1329821482);
473 return $this->
getStorage()->renameFile($this, $newName);
488 if ($this->deleted) {
489 throw new \RuntimeException(
'File has been deleted.', 1329821483);
491 return $targetFolder->
getStorage()->copyFile($this, $targetFolder, $targetFileName, $conflictMode);
506 if ($this->deleted) {
507 throw new \RuntimeException(
'File has been deleted.', 1329821484);
509 return $targetFolder->
getStorage()->moveFile($this, $targetFolder, $targetFileName, $conflictMode);
526 if ($this->deleted) {
529 return $this->
getStorage()->getPublicUrl($this, $relativeToCurrentScript);
545 if ($this->deleted) {
546 throw new \RuntimeException(
'File has been deleted.', 1329821486);
548 return $this->
getStorage()->getFileForLocalProcessing($this, $writable);