ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
SimpleFile.php
Go to the documentation of this file.
1<?php
2
3namespace Sabre\DAV;
4
16class SimpleFile extends File {
17
23 protected $contents = [];
24
30 protected $name;
31
37 protected $mimeType;
38
49 function __construct($name, $contents, $mimeType = null) {
50
51 $this->name = $name;
52 $this->contents = $contents;
53 $this->mimeType = $mimeType;
54
55 }
56
64 function getName() {
65
66 return $this->name;
67
68 }
69
77 function get() {
78
79 return $this->contents;
80
81 }
82
88 function getSize() {
89
90 return strlen($this->contents);
91
92 }
93
103 function getETag() {
104
105 return '"' . sha1($this->contents) . '"';
106
107 }
108
115 function getContentType() {
116
117 return $this->mimeType;
118
119 }
120
121}
An exception for terminatinating execution or to throw for unit testing.
File class.
Definition: File.php:15
getSize()
Returns the size of the file, in bytes.
Definition: SimpleFile.php:88
__construct($name, $contents, $mimeType=null)
Creates this node.
Definition: SimpleFile.php:49
getName()
Returns the node name for this file.
Definition: SimpleFile.php:64
getETag()
Returns the ETag for a file.
Definition: SimpleFile.php:103
getContentType()
Returns the mime-type for a file.
Definition: SimpleFile.php:115