The Hubzilla
 All Classes Namespaces Files Functions Variables Pages
Zotlabs\Storage\File Class Reference

This class represents a file in DAV. More...

Inheritance diagram for Zotlabs\Storage\File:
[legend]

Public Member Functions

 __construct ($name, $data, &$auth)
 
 getName ()
 Returns the name of the file. More...
 
 setName ($newName)
 Renames the file. More...
 
 put ($data)
 Updates the data of the file. More...
 
 get ()
 Returns the raw data. More...
 
 getETag ()
 Returns the ETag for a file. More...
 
 getContentType ()
 Returns the mime-type for a file. More...
 
 getSize ()
 Returns the size of the node, in bytes. More...
 
 getLastModified ()
 Returns the last modification time for the file, as a unix timestamp. More...
 
 delete ()
 Delete the file. More...
 

Private Attributes

array $data
 
Zotlabs Storage BasicAuth $auth
 
string $name
 

Detailed Description

This class represents a file in DAV.

It provides all functions to work with files in Red's cloud through DAV protocol.

\DAV\Node \DAV\IFile

License: http://opensource.org/licenses/mit-license.php The MIT License (MIT)

Constructor & Destructor Documentation

Zotlabs\Storage\File::__construct (   $name,
  $data,
$auth 
)

Sets up the node, expects a full path name.

Parameters
string$name
array$datafrom attach table
&$auth

Member Function Documentation

Zotlabs\Storage\File::delete ( )

Delete the file.

This method checks the permissions and then calls attach_delete() function to actually remove the file.

Exceptions
\Sabre\DAV\Exception\Forbidden
Zotlabs\Storage\File::get ( )

Returns the raw data.

Returns
string
Zotlabs\Storage\File::getContentType ( )

Returns the mime-type for a file.

If null is returned, we'll assume application/octet-stream

Returns
mixed
Zotlabs\Storage\File::getETag ( )

Returns the ETag for a file.

An ETag is a unique identifier representing the current version of the file. If the file changes, the ETag MUST change. The ETag is an arbitrary string, but MUST be surrounded by double-quotes.

Return null if the ETag can not effectively be determined.

Returns
null|string
Zotlabs\Storage\File::getLastModified ( )

Returns the last modification time for the file, as a unix timestamp.

Returns
int last modification time in UNIX timestamp
Zotlabs\Storage\File::getName ( )

Returns the name of the file.

Returns
string
Zotlabs\Storage\File::getSize ( )

Returns the size of the node, in bytes.

Returns
int filesize in bytes
Zotlabs\Storage\File::put (   $data)

Updates the data of the file.

Parameters
resource$data
Returns
void
Zotlabs\Storage\File::setName (   $newName)

Renames the file.

Exceptions
\Sabre\DAV\Exception\Forbidden
Parameters
string$newNameThe new name of the file.
Returns
void

Member Data Documentation

Zotlabs Storage BasicAuth Zotlabs\Storage\File::$auth
private
See Also
\Sabre\DAV\Auth\Backend\BackendInterface $auth
array Zotlabs\Storage\File::$data
private

The file from attach table.

$data

  • data
  • flags
  • filename (string)
  • filetype (string)
string Zotlabs\Storage\File::$name
private

$name


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