Nextcloud PHP API (master)

InMemoryFile
in package
implements ISimpleFile

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

Tags
since
16.0.0

Table of Contents

Interfaces

ISimpleFile
This interface allows to manage simple files.

Properties

$contents  : string
Holds the file contents.
$name  : string
Holds the file name.

Methods

__construct()  : mixed
InMemoryFile constructor.
delete()  : void
In memory files can't be deleted.
getContent()  : string
Get the content
getETag()  : string
Get the ETag
getExtension()  : string
getMimeType()  : string
Get the MimeType
getMTime()  : int
Get the last modification time
getName()  : string
Get the name
getSize()  : int|float
Get the size in bytes
putContent()  : void
Overwrite the file
read()  : resource|false
Stream reading is unsupported for in memory files.
write()  : resource|bool
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

delete()

In memory files can't be deleted.

public delete() : void
Tags
since
16.0.0

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

getExtension()

public getExtension() : string
Tags
since
24.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|float
Tags
inheritdoc
since
16.0.0
Return values
int|float

putContent()

Overwrite the file

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

read()

Stream reading is unsupported for in memory files.

public read() : resource|false
Tags
throws
NotPermittedException
since
16.0.0
Return values
resource|false

write()

Stream writing isn't available for in memory files.

public write() : resource|bool
Tags
throws
NotPermittedException
since
16.0.0
Return values
resource|bool

        
On this page

Search results