Class MOXMAN_AmazonS3_File

InheritanceMOXMAN_AmazonS3_File » MOXMAN_Vfs_BaseFile
ImplementsMOXMAN_Vfs_IFile

This is a AmazonS3 implementation of the MOXMAN_Vfs_IFile.

Public Methods

Hide inherited methods

MethodDescriptionDefined By
__construct() Constructs a new file instance. MOXMAN_AmazonS3_File
canRead() Returns true if the files is readable. MOXMAN_Vfs_BaseFile
canWrite() Returns true if the files is writable. MOXMAN_Vfs_BaseFile
copyTo() Copies this file to the specified file instance. MOXMAN_AmazonS3_File
delete() Deletes the file. MOXMAN_AmazonS3_File
exists() Returns true if the file exists. MOXMAN_AmazonS3_File
exportTo() Exports the file to the local system, for example a file from a zip or db file system. MOXMAN_AmazonS3_File
getConfig() Returns a config instance for the current file. The config is provided by the FileConfigProvider specified for the file system. MOXMAN_Vfs_BaseFile
getFileList() Lists files in the specified path and returns an array with stat info details. MOXMAN_AmazonS3_File
getFileSystem() Returns the file system that created the file. MOXMAN_Vfs_BaseFile
getInternalPath() Returns the file system internal path. This is used when oding requests on the remote server. MOXMAN_AmazonS3_File
getLastModified() Returns last modification date in ms as an long. MOXMAN_AmazonS3_File
getMetaData() Returns a meta data instance for the current file. MOXMAN_Vfs_BaseFile
getName() Returns the file name of a file. MOXMAN_Vfs_BaseFile
getParent() Returns the parent files absolute path or an empty string if there is no parent. MOXMAN_Vfs_BaseFile
getParentFile() Returns the parent files File instance. MOXMAN_Vfs_BaseFile
getPath() Returns the absolute path of the file. MOXMAN_Vfs_BaseFile
getPublicLinkPath() Returns the public path of a file that this file points to. MOXMAN_Vfs_BaseFile
getPublicPath() Returns the public path for a file. A public path is a path that is safe to pass to the client side since it doesn't show the systems full path. MOXMAN_Vfs_BaseFile
getSize() Returns file size as an long. MOXMAN_AmazonS3_File
getStatItem() Returns a stat item or the default value if it wasn't found. MOXMAN_AmazonS3_File
getUrl() Returns the absolute public URL for the file. MOXMAN_AmazonS3_File
importFrom() Imports a local file to the file system, for example when users upload files. MOXMAN_AmazonS3_File
isDirectory() Returns true if the file is a directory. MOXMAN_Vfs_BaseFile
isFile() Returns true if the file is a file. MOXMAN_AmazonS3_File
isHidden() Returns true if the file is hidden. MOXMAN_Vfs_BaseFile
listFiles() Returns an array of File instances. MOXMAN_Vfs_BaseFile
listFilesFiltered() Returns an array of MCE_File instances based on the specified filter instance. MOXMAN_AmazonS3_File
mkdir() Creates a new directory. MOXMAN_AmazonS3_File
moveTo() Moves this file to the specified file instance. MOXMAN_AmazonS3_File
open() Opens a file stream by the specified mode. The default mode is rb. MOXMAN_AmazonS3_File
removeStatCache() MOXMAN_AmazonS3_File

Method Details

__construct() public method

Constructs a new file instance.

public void __construct ( MOXMAN_Vfs_FileSystem $fileSystem, $path, $stat null )
$fileSystem MOXMAN_Vfs_FileSystem

File system instance for the file.

$path String

Path for the file.

$stat Array

File stat info or null.

copyTo() public method

Copies this file to the specified file instance.

public void copyTo ( MOXMAN_Vfs_IFile $dest )
$dest \MCE_File

File to copy to.

delete() public method

Deletes the file.

public void delete ( $deep false )
$deep boolean

If this option is enabled files will be deleted recurive.

exists() public method

Returns true if the file exists.

public boolean exists ( )
return boolean

True if the file exists.

exportTo() public method

Exports the file to the local system, for example a file from a zip or db file system.

Implementations of this method should also support directory recursive exporting.

public void exportTo ( $localPath )
$localPath String

Absolute path to local file.

getFileList() public method

Lists files in the specified path and returns an array with stat info details.

public Array getFileList ( $path )
$path String

Path to list files in.

return Array

Array with stat info name/value arrays.

getInternalPath() public method

Returns the file system internal path. This is used when oding requests on the remote server.

public String getInternalPath ( $path null )
$path String

Optional path to convert into internal an internal path.

return String

Internal file system path.

getLastModified() public method

Returns last modification date in ms as an long.

public \long getLastModified ( )
return \long

Last modification date in ms as an long.

getSize() public method

Returns file size as an long.

public \long getSize ( )
return \long

File size as an long.

getStatItem() public method

Returns a stat item or the default value if it wasn't found.

public mixed getStatItem ( $key, $default false )
$key String

Key of stat item to get.

$default mixed

Default value to return.

return mixed

Value of stat item or default.

getUrl() public method

Returns the absolute public URL for the file.

public String getUrl ( )
return String

Absolute public URL for the file.

importFrom() public method

Imports a local file to the file system, for example when users upload files.

Implementations of this method should also support directory recursive importing.

public void importFrom ( $localPath )
$localPath String

Absolute path to local file.

isFile() public method

Returns true if the file is a file.

public boolean isFile ( )
return boolean

True if the file is a file.

listFilesFiltered() public method

Returns an array of MCE_File instances based on the specified filter instance.

public MOXMAN_Vfs_FileList listFilesFiltered ( MOXMAN_Vfs_IFileFilter $filter )
$filter \MCE_FileFilter

MCE_FileFilter instance to filter files by.

return MOXMAN_Vfs_FileList

List of MOXMAN_Vfs_IFile instances.

mkdir() public method

Creates a new directory.

public void mkdir ( )
moveTo() public method

Moves this file to the specified file instance.

public void moveTo ( MOXMAN_Vfs_IFile $dest )
$dest \MCE_File

File to rename/move to.

open() public method

Opens a file stream by the specified mode. The default mode is rb.

public MOXMAN_Vfs_IFileStream open ( $mode = \MOXMAN_Vfs_IStream::READ )
$mode String

Mode to open file by, r, rb, w, wb etc.

return MOXMAN_Vfs_IFileStream

File stream implementation for the file system.

removeStatCache() public method

public void removeStatCache ( )