ILIAS  Release_4_2_x_branch Revision 61807
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilObjFileDAV Class Reference
+ Inheritance diagram for ilObjFileDAV:
+ Collaboration diagram for ilObjFileDAV:

Public Member Functions

 ilObjFileDAV ($refid, $obj=null)
 Constructor.
 initFromNull ()
 Initializes the object after it has been converted from the NULL type.
 createNewVersion ()
 Creates a new version of the object.
 getResourceType ()
 Returns the display name of this object.
 getContentType ()
 Returns the mime type of the content of this object.
 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.
 getContentLength ()
 Returns the number of bytes of the content.
 getContentStream ()
 Returns the content of the object as a stream.
 getContentOutputStream ()
 Returns an output stream to the content.
 getContentOutputStreamLength ()
 Returns the length of the content output stream.
 getContentData ()
 Returns the content of the object as a byte array.
 read ()
 Reads the object data.
 write ()
 Writes the object data.
- Public Member Functions inherited from ilObjectDAV
 ilObjectDAV ($refId, $obj=null)
 Constructor.
 getRefId ()
 Returns the ref id of this object.
 getObjectId ()
 Returns the object id of this object.
 getNodeId ()
 Returns the node id of this object.
 getResourceName ()
 Returns the resource name of this object.
 setResourceName ($name)
 Sets the resource name of this object.
 getDisplayName ()
 Returns the display name of this object.
 getCreationTimestamp ()
 Returns the creation date of this object as a Unix timestamp.
 getModificationTimestamp ()
 Returns the modification date of this object as a Unix timestamp.
 isCollection ()
 Returns true if this object is a DAV collection.
 isFile ()
 Returns true if this object is a DAV file.
 isNullResource ()
 Returns true if this is a null resource.
 isOnline ()
 Returns true if the object is online.
 isPermitted ($operations, $type= '')
 Returns whether a specific operation is permitted for the current user.
 getILIASType ()
 Returns the ilias type of the current object.
 getILIASCollectionType ()
 Returns the ilias type for collections that can be created as children of this object.
 getILIASFileType ()
 Returns the ilias type for files that can be created as children of this object.
 createCollection ($name)
 Creates a dav collection as a child of this object.
 createFile ($name)
 Creates a dav file as a child of this object.
 createFileFromNull ($name, &$nullDAV)
 Creates a dav file as a child of this object.
 createNull ($name)
 Creates a dav null object as a child of this object.
 remove ($objDAV)
 Removes the specified child from this object.
 addCopy (&$objDAV, $newName=null)
 Adds a copy of the specified object as a child to this object.
 cloneNodes ($srcRef, $dstRef, &$mapping, $newName=null)
 Recursively clones all nodes of the RBAC tree.
 addMove (&$objDAV, $newName=null)
 Adds (moves) the specified object as a child to this object.
 removeDeletedNodes ($a_node_id, $a_checked, $a_delete_objects=true)
 remove already deleted objects within the objects in trash recursive function
 children ()
 Returns the children of this object.
 childrenWithPermission ($operations, $type='')
 Returns the children of this object with the specified permissions.
 createObject ($refId, $type)
 Static factory method to create a DAV object for a given refId and type.
 writelog ($message)
 Writes a message to the logfile.,.
 __toString ()
 This method is needed, because the object class in PHP 5.2 does not have a default implementation of this method anymore.

Additional Inherited Members

- Data Fields inherited from ilObjectDAV
 $refId
 Refid to the object.
 $obj
 Application layer object.
 $isDebug = false
 The ObjectDAV prints lots of log messages to the ilias log, if this variable is set to true.

Detailed Description

Definition at line 43 of file class.ilObjFileDAV.php.

Member Function Documentation

ilObjFileDAV::createNewVersion ( )

Creates a new version of the object.

Only objects which support versioning need to implement this method.

Reimplemented from ilObjectDAV.

Definition at line 76 of file class.ilObjFileDAV.php.

References ilHistory\_createEntry().

{
$this->obj->setVersion($this->obj->getVersion() + 1);
ilHistory::_createEntry($this->obj->getId(), "replace",
$this->obj->getFileName().",".$this->obj->getVersion());
}

+ Here is the call graph for this function:

ilObjFileDAV::getContentData ( )

Returns the content of the object as a byte array.

Returns
Array, String. Return null if the content can not be delivered as data.

Reimplemented from ilObjectDAV.

Definition at line 184 of file class.ilObjFileDAV.php.

{
return null;
}
ilObjFileDAV::getContentLength ( )

Returns the number of bytes of the content.

Returns
int.

Reimplemented from ilObjectDAV.

Definition at line 136 of file class.ilObjFileDAV.php.

References ilObjFile\_lookupFileSize().

{
return ilObjFile::_lookupFileSize($this->obj->getId());
}

+ Here is the call graph for this function:

ilObjFileDAV::getContentOutputStream ( )

Returns an output stream to the content.

Returns
Stream or null, if the content does not support streaming.

Reimplemented from ilObjectDAV.

Definition at line 153 of file class.ilObjFileDAV.php.

References $file, and ilUtil\makeDirParents().

{
$file = $this->obj->getFile();
$parent = dirname($file);
if (! file_exists($parent))
{
}
return fopen($file,'w');
}

+ Here is the call graph for this function:

ilObjFileDAV::getContentOutputStreamLength ( )

Returns the length of the content output stream.

This method is used by the ilDAVServer, if a PUT operation has been performed for which the client did not specify the content length.

Parameters
Integer.

Reimplemented from ilObjectDAV.

Definition at line 173 of file class.ilObjFileDAV.php.

References $file.

{
$file = $this->obj->getFile();
return file_exists($file) ? filesize($file) : 0;
}
ilObjFileDAV::getContentStream ( )

Returns the content of the object as a stream.

Returns
Stream or null, if the content does not support streaming.

Reimplemented from ilObjectDAV.

Definition at line 144 of file class.ilObjFileDAV.php.

References $file.

{
$file = $this->obj->getFile();
return (file_exists($file)) ? fopen($file,'r') : null;
}
ilObjFileDAV::getContentType ( )

Returns the mime type of the content of this object.

Returns
String.

Reimplemented from ilObjectDAV.

Definition at line 110 of file class.ilObjFileDAV.php.

{
//return $this->obj->getFileType();
return $this->obj->guessFileType();
}
ilObjFileDAV::getResourceType ( )

Returns the display name of this object.

Precondition: Object must have been read.

Returns
String. FIXME - Method deactivated. We don't display the file name as display name. Because the file name is not necessarily known to the user. / function getDisplayName() { return $this->obj->getFileName(); } Returns the DAV resource type of this object.
String "collection" or "".

Reimplemented from ilObjectDAV.

Definition at line 101 of file class.ilObjFileDAV.php.

{
return "";
}
ilObjFileDAV::ilObjFileDAV (   $refid,
  $obj = null 
)

Constructor.

Parameters
refidA refid to the object.

Definition at line 50 of file class.ilObjFileDAV.php.

References ilObjectDAV\$obj, and ilObjectDAV\ilObjectDAV().

{
$this->ilObjectDAV($refid, $obj);
// Set debug to true, if you want to get debug output for this
// object
//$this->isDebug = true;
}

+ Here is the call graph for this function:

ilObjFileDAV::initFromNull ( )

Initializes the object after it has been converted from the NULL type.

We create all the additonal object data that is needed, to make the object work.

Returns
void.

Reimplemented from ilObjectDAV.

Definition at line 65 of file class.ilObjFileDAV.php.

References ilObjectDAV\getRefId(), ilObjectDAV\getResourceName(), and write().

{
$this->obj->setFileName($this->getResourceName());
$this->obj->setFileType($this->obj->guessFileType());
$this->write();
$this->obj->setPermissions($this->getRefId());
}

+ Here is the call graph for this function:

ilObjFileDAV::read ( )

Reads the object data.

Returns
void.

Reimplemented from ilObjectDAV.

Definition at line 192 of file class.ilObjFileDAV.php.

References ilObjectDAV\getRefId().

{
if (is_null($this->obj))
{
$this->obj = &new ilObjFile($this->getRefId(),true);
$this->obj->read();
}
}

+ Here is the call graph for this function:

ilObjFileDAV::setContentLength (   $length)

Sets the length (in bytes) of the content of this object.

Parameters
Integer.

Reimplemented from ilObjectDAV.

Definition at line 127 of file class.ilObjFileDAV.php.

{
$this->writeLog('setContentLength('.$length.')');
$this->obj->setFileSize($length);
}
ilObjFileDAV::setContentType (   $type)

Sets the mime type of the content of this object.

Parameters
String.

Reimplemented from ilObjectDAV.

Definition at line 119 of file class.ilObjFileDAV.php.

{
$this->obj->setFileType($type);
}
ilObjFileDAV::write ( )

Writes the object data.

Returns
void.

Reimplemented from ilObjectDAV.

Definition at line 204 of file class.ilObjFileDAV.php.

Referenced by initFromNull().

{
$this->isNewFile = $this->obj->getVersion() == 0;
if ($this->isNewFile)
{
$this->obj->setVersion(1);
}
/*
ilHistory::_createEntry($this->getObjectId(), 'update', '', '','', true);
*/
}

+ Here is the caller graph for this function:


The documentation for this class was generated from the following file: