Nextcloud PHP API (stable18)

InMemoryFile implements ISimpleFile

This class represents a file that is only hold in memory.

Tags
since
16.0.0

Interfaces, Classes and Traits

ISimpleFile
Interface ISimpleFile

Table of Contents

$contents  : string
Holds the file contents.
$name  : string
Holds the file name.
__construct()  : mixed
InMemoryFile constructor.
delete()  : mixed
In memory files can't be deleted.
getContent()  : string
Get the content
getETag()  : string
Get the ETag
getMimeType()  : string
Get the MimeType
getMTime()  : int
Get the last modification time
getName()  : string
Get the name
getSize()  : int
Get the size in bytes
putContent()  : mixed
Overwrite the file
read()  : resource
Stream reading is unsupported for in memory files.
write()  : resource
Stream writing isn't available for in memory files.

Properties

$contents

Holds the file contents.

private string $contents

Methods

__construct()

InMemoryFile constructor.

public __construct(string $name, string $contents) : mixed
Parameters
$name : string

The file name

$contents : string

The file contents

Tags
since
16.0.0
Return values
mixed

delete()

In memory files can't be deleted.

public delete() : mixed
Tags
since
16.0.0
Return values
mixed

getContent()

Get the content

public getContent() : string
Tags
inheritdoc
since
16.0.0
Return values
string

getETag()

Get the ETag

public getETag() : string
Tags
inheritdoc
since
16.0.0
Return values
string

getMimeType()

Get the MimeType

public getMimeType() : string
Tags
inheritdoc
since
16.0.0
Return values
string

getMTime()

Get the last modification time

public getMTime() : int
Tags
inheritdoc
since
16.0.0
Return values
int

getName()

Get the name

public getName() : string
Tags
inheritdoc
since
16.0.0
Return values
string

getSize()

Get the size in bytes

public getSize() : int
Tags
inheritdoc
since
16.0.0
Return values
int

putContent()

Overwrite the file

public putContent(mixed $data) : mixed
Parameters
$data : mixed
Tags
inheritdoc
since
16.0.0
Return values
mixed

Search results