\OCPFiles

This class provides access to the internal filesystem abstraction layer. Use this class exlusively if you want to access files

Summary

Methods
Properties
Constants
rmdirr()
getMimeType()
searchByMime()
streamCopy()
tmpFile()
tmpFolder()
buildNotExistingFileName()
getStorage()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Methods

rmdirr()

rmdirr(  $dir) : boolean

Recusive deletion of folders

Parameters

$dir

Returns

boolean

getMimeType()

getMimeType(string  $path) : string

Get the mimetype form a local file

Parameters

string $path

Returns

string —

does NOT work for ownClouds filesystem, use OC_FileSystem::getMimeType instead

searchByMime()

searchByMime(string  $mimetype) : array

Search for files by mimetype

Parameters

string $mimetype

Returns

array

streamCopy()

streamCopy(resource  $source, resource  $target) : integer

Copy the contents of one stream to another

Parameters

resource $source
resource $target

Returns

integer —

the number of bytes copied

tmpFile()

tmpFile(string  $postfix = '') : string

Create a temporary file with an unique filename

Parameters

string $postfix

Returns

string —

temporary files are automatically cleaned up after the script is finished

tmpFolder()

tmpFolder() : string

Create a temporary folder with an unique filename

Returns

string —

temporary files are automatically cleaned up after the script is finished

buildNotExistingFileName()

buildNotExistingFileName(string  $path, string  $filename) : string

Adds a suffix to the name in case the file exists

Parameters

string $path
string $filename

Returns

string

getStorage()

getStorage(string  $app) : \OC\Files\View

Gets the Storage for an app - creates the needed folder if they are not existent

Parameters

string $app

Returns

\OC\Files\View