25 require_once
"class.ilObjectDAV.php";
27 require_once
'./Services/History/classes/class.ilHistory.php';
28 require_once
'Services/Utilities/classes/class.ilUtil.php';
29 require_once
"Modules/File/classes/class.ilObjFile.php";
52 parent::__construct($refid,
$obj);
68 $this->obj->setFileType($this->obj->guessFileType());
70 $this->obj->setPermissions($this->
getRefId());
78 $this->obj->setVersion($this->obj->getVersion() + 1);
82 $this->obj->getFileName() .
"," . $this->obj->getVersion()
117 return $this->obj->guessFileType();
125 $this->obj->setFileType(
$type);
133 $this->writeLog(
'setContentLength(' . $length .
')');
134 $this->obj->setFileSize($length);
150 $file = $this->obj->getFile();
151 return (file_exists(
$file)) ? fopen(
$file,
'r') : null;
159 $file = $this->obj->getFile();
160 $parent = dirname(
$file);
161 if (!file_exists($parent)) {
165 return fopen(
$file,
'w');
178 $file = $this->obj->getFile();
179 return file_exists(
$file) ? filesize(
$file) : 0;
196 if (is_null($this->obj)) {
207 $this->isNewFile = $this->obj->getVersion() == 0;
208 if ($this->isNewFile) {
209 $this->obj->setVersion(1);
static makeDirParents($a_dir)
Create a new directory and all parent directories.
read()
Reads the object data.
write()
Writes the object data.
initFromNull()
Initializes the object after it has been converted from the NULL type.
getContentLength()
Returns the number of bytes of the content.
static _createEntry( $a_obj_id, $a_action, $a_info_params="", $a_obj_type="", $a_user_comment="", $a_update_last=false)
Creates a new history entry for an object.
getContentStream()
Returns the content of the object as a stream.
getContentOutputStreamLength()
Returns the length of the content output stream.
getContentData()
Returns the content of the object as a byte array.
getResourceName()
Returns the resource name of this object.
createNewVersion()
Creates a new version of the object.
getResourceType()
Returns the display name of this object.
static _lookupFileSize($a_id)
Lookups the file size of the file in bytes.
setContentType($type)
Sets the mime type of the content of this object.
setContentLength($length)
Sets the length (in bytes) of the content of this object.
__construct($refid, $obj=null)
Constructor.
if(!file_exists("$old.txt")) if($old===$new) if(file_exists("$new.txt")) $file
$obj
Application layer object.
getContentType()
Returns the mime type of the content of this object.
getContentOutputStream()
Returns an output stream to the content.
getRefId()
Returns the ref id of this object.