Class

eZ\Publish\Core\REST\Client\IOService

class IOService implements IOService, Sessionable

Service used to handle io operations.

Methods

__construct(HttpClient $client, Dispatcher $inputDispatcher, Visitor $outputVisitor, RequestParser $requestParser)

setSession(mixed $id)

Set session ID.

BinaryFileCreateStruct newBinaryCreateStructFromUploadedFile(array $uploadedFile)

Creates a BinaryFileCreateStruct object from the uploaded file $uploadedFile.

BinaryFileCreateStruct newBinaryCreateStructFromLocalFile(string $localFile)

Creates a BinaryFileCreateStruct object from $localFile.

BinaryFile createBinaryFile(BinaryFileCreateStruct $binaryFileCreateStruct)

Creates a binary file in the the repository.

deleteBinaryFile(BinaryFile $binaryFile)

Deletes the BinaryFile with $path.

BinaryFile loadBinaryFile($binaryFileId)

Loads the binary file with $id.

resource getFileInputStream(BinaryFile $binaryFile)

Returns a read (mode: rb) file resource to the binary file identified by $path.

string getFileContents(BinaryFile $binaryFile)

Returns the content of the binary file.

Details

at line 50
public __construct(HttpClient $client, Dispatcher $inputDispatcher, Visitor $outputVisitor, RequestParser $requestParser)

Parameters

HttpClient $client
Dispatcher $inputDispatcher
Visitor $outputVisitor
RequestParser $requestParser

at line 67
public setSession(mixed $id)

Set session ID.

Only for testing

Parameters

mixed $id tringid

at line 83
public BinaryFileCreateStruct newBinaryCreateStructFromUploadedFile(array $uploadedFile)

Creates a BinaryFileCreateStruct object from the uploaded file $uploadedFile.

Parameters

array $uploadedFile The $_POST hash of an uploaded file

Return Value

BinaryFileCreateStruct

Exceptions

InvalidArgumentException When given an invalid uploaded file

at line 97
public BinaryFileCreateStruct newBinaryCreateStructFromLocalFile(string $localFile)

Creates a BinaryFileCreateStruct object from $localFile.

Parameters

string $localFile Path to local file

Return Value

BinaryFileCreateStruct

Exceptions

InvalidArgumentException When given a non existing / unreadable file

at line 109
public BinaryFile createBinaryFile(BinaryFileCreateStruct $binaryFileCreateStruct)

Creates a binary file in the the repository.

Parameters

BinaryFileCreateStruct $binaryFileCreateStruct

Return Value

BinaryFile The created BinaryFile object

at line 119
public deleteBinaryFile(BinaryFile $binaryFile)

Deletes the BinaryFile with $path.

Parameters

BinaryFile $binaryFile

at line 133
public BinaryFile loadBinaryFile($binaryFileId)

Loads the binary file with $id.

Parameters

$binaryFileId

Return Value

BinaryFile

Exceptions

NotFoundException

at line 145
public resource getFileInputStream(BinaryFile $binaryFile)

Returns a read (mode: rb) file resource to the binary file identified by $path.

Parameters

BinaryFile $binaryFile

Return Value

resource

at line 157
public string getFileContents(BinaryFile $binaryFile)

Returns the content of the binary file.

Parameters

BinaryFile $binaryFile

Return Value

string