TYPO3CMS  8
 All Classes Namespaces Files Functions Variables Pages
FileInterface Interface Reference
Inheritance diagram for FileInterface:
ResourceInterface AbstractFile FileReference File ProcessedFile

Public Member Functions

 hasProperty ($key)
 
 getProperty ($key)
 
 getSize ()
 
 getSha1 ()
 
 getNameWithoutExtension ()
 
 getExtension ()
 
 getMimeType ()
 
 getModificationTime ()
 
 getCreationTime ()
 
 getContents ()
 
 setContents ($contents)
 
 delete ()
 
 rename ($newName)
 
 getPublicUrl ($relativeToCurrentScript=false)
 
 isIndexed ()
 
 getForLocalProcessing ($writable=true)
 
 toArray ()
 
- Public Member Functions inherited from ResourceInterface
 getIdentifier ()
 
 getName ()
 
 getStorage ()
 
 getHashedIdentifier ()
 
 getParentFolder ()
 

Detailed Description

File Interface

Definition at line 20 of file FileInterface.php.

Member Function Documentation

delete ( )

Deletes this file from its storage. This also means that this object becomes useless.

Returns
bool TRUE if deletion succeeded

Implemented in AbstractFile, and FileReference.

getContents ( )

Get the contents of this file

Returns
string File contents

Implemented in FileReference, AbstractFile, and File.

getCreationTime ( )

Returns the creation time of the file as Unix timestamp

Returns
int

Implemented in FileReference, and AbstractFile.

getForLocalProcessing (   $writable = true)

Returns a path to a local version of this file to process it locally (e.g. with some system tool). If the file is normally located on a remote storages, this creates a local copy. If the file is already on the local system, this only makes a new copy if $writable is set to TRUE.

Parameters
bool$writableSet this to FALSE if you only want to do read operations on the file.
Returns
string

Implemented in AbstractFile, and FileReference.

Referenced by PlainTextExtractor\extractText().

getModificationTime ( )

Returns the modification time of the file as Unix timestamp

Returns
int

Implemented in FileReference, and AbstractFile.

getNameWithoutExtension ( )

Returns the basename (the name without extension) of this file.

Returns
string

Implemented in FileReference, and AbstractFile.

getPublicUrl (   $relativeToCurrentScript = false)

Returns a publicly accessible URL for this file

WARNING: Access to the file may be restricted by further means, e.g. some web-based authentication. You have to take care of this yourself.

Parameters
bool$relativeToCurrentScriptDetermines whether the URL returned should be relative to the current script, in case it is relative at all (only for the LocalDriver)
Returns
string

Implemented in ProcessedFile, AbstractFile, FileReference, and File.

Referenced by ImageService\getImageUri(), VideoTagRenderer\render(), and AudioTagRenderer\render().

getSha1 ( )

Returns the Sha1 of this file

Returns
string

Implemented in FileReference, AbstractFile, and File.

getSize ( )

Returns the size of this file

Returns
int

Implemented in FileReference, and AbstractFile.

Referenced by ResourceStorage\dumpFileContents().

hasProperty (   $key)

Returns true if the given key exists for this file.

Parameters
string$key
Returns
bool

Implemented in FileReference, AbstractFile, and File.

Referenced by GalleryProcessor\getCroppedDimensionalProperty(), and FileCollector\sort().

isIndexed ( )

Returns TRUE if this file is indexed

Returns
bool

Implemented in FileReference, ProcessedFile, and File.

rename (   $newName)

Renames this file.

Parameters
string$newNameThe new file name
Returns
File

Implemented in AbstractFile, and FileReference.

setContents (   $contents)

Replace the current file contents with the given string.

: Consider to remove this function from the interface, as its : At the same time, it could be considered whether to make the whole

Parameters
string$contentsThe contents to write to the file.
Returns
File The file object (allows chaining).

Implemented in FileReference, AbstractFile, ProcessedFile, and File.

toArray ( )

Returns an array representation of the file. (This is used by the generic listing module vidi when displaying file records.)

Returns
array Array of main data of the file. Don't rely on all data to be present here, it's just a selection of the most relevant information.

Implemented in FileReference, ProcessedFile, and File.