|
ColdBox Platform - WireBox Version 1.1.1 | ||||
| FRAMES | |||||
WEB-INF.cftags.component
wirebox.system.core.util.FileUtils
public class FileUtils
This is a File Utilities CFC
| Method Summary | |
|---|---|
void |
appendFile(any FileToSave, any FileContents, [string CharSet='utf-8'], [boolean CheckCharSetFlag='false'])
Facade to append to a file's content |
string |
checkCharSet(string charset)
Check a charset with valid CF char sets, if invalid, it returns the framework's default character set |
void |
createFile(String filename)
Create a new empty fileusing java |
void |
directoryCopy(string source, string destination, any nameconflict='overwrite')
Copies an entire source directory to a destination directory |
void |
directoryCreate(string path='', [string mode='755'])
Create a new directory |
void |
directoryNew(string path, string name)
Creates a new directory on the file system |
void |
directoryRemove(string path='', [boolean recurse='true'])
Remove an entire directory |
void |
directoryRename(string path, string name)
Renames a directory on the file system |
boolean |
fileCanRead(String Filename)
Check wether you can read a file |
boolean |
fileCanWrite(String Filename)
Check wether you can write to a file |
string |
fileLastModified(string filename)
Get the last modified date of a file |
string |
fileSize(string filename, [string sizeFormat='bytes'])
Get the filesize of a file |
string |
getAbsolutePath(string path)
Turn any system path, either relative or absolute, into a fully qualified one |
string |
getFileMimeType(string extension)
Get's the file mime type for a given file extension |
boolean |
isDirectory(String Filename)
Check wether the filename argument is a directory or not |
boolean |
isFile(String Filename)
Checks whether the filename argument is a file or not |
Any |
readFile(String FileToRead, [boolean ReadInBinaryFlag='false'], [string CharSet=''], [boolean CheckCharSetFlag='false'])
Facade to Read a file's content |
boolean |
removeFile(string filename)
Remove a file using java |
string |
ripExtension(string filename)
Rip the extension of a filename |
void |
saveFile(any FileToSave, any FileContents, [string CharSet='utf-8'], [boolean CheckCharSetFlag='false'])
Facade to save a file's content |
void |
sendFile([any file=''], [string name=''], [string mimeType=''], [string disposition='attachment'], [boolean abortAtEnd='false'], [string extension=''], [string deleteFile='false'])
Send a file to the browser |
any |
uploadFile(string fileField, string destination, [string nameConflict='makeunique'], [string accept=''], [string attributes='Normal'], [string mode='755'])
Facade to upload to a file, returns the cffile variable |
| Methods inherited from class WEB-INF.cftags.component |
|---|
|
| Method Detail |
|---|
public void appendFile(any FileToSave, any FileContents, [string CharSet='utf-8'], [boolean CheckCharSetFlag='false'])
FileToSave - The absolute path to the file.FileContents - The file contentsCharSet - CF File CharSet Encoding to use.CheckCharSetFlag - Check the charset.public string checkCharSet(string charset)
charset - Charset to checkpublic void createFile(String filename)
filename - The absolute path of the file to create.public void directoryCopy(string source, string destination, any nameconflict='overwrite')
sourcedestinationnameconflictpublic void directoryCreate(string path='', [string mode='755'])
path - The full path to removemode - The mode of the file for Unix systems, the default is 755public void directoryNew(string path, string name)
path - The absolute path of the base directory. The new directory will be a sub-directory of this path.name - The name of the new directory.public void directoryRemove(string path='', [boolean recurse='true'])
path - The full path to removerecurse - Recurse or notpublic void directoryRename(string path, string name)
path - The absolute path of the directory. This directory will be renamed to the name argument.name - The new name of the directory.public boolean fileCanRead(String Filename)
Filename - The absolute path of the file to check.public boolean fileCanWrite(String Filename)
Filename - The absolute path of the file to check.public string fileLastModified(string filename)
filenamepublic string fileSize(string filename, [string sizeFormat='bytes'])
filenamesizeFormat - Available formats: [bytes][kbytes][mbytes][gbytes]public string getAbsolutePath(string path)
path - Abstract pathnamepublic string getFileMimeType(string extension)
extension - e.g. jpg or gifpublic boolean isDirectory(String Filename)
Filename - The absolute path of the file to check.public boolean isFile(String Filename)
Filename - The absolute path of the file to check.public Any readFile(String FileToRead, [boolean ReadInBinaryFlag='false'], [string CharSet=''], [boolean CheckCharSetFlag='false'])
FileToRead - The absolute path to the file.ReadInBinaryFlag - Read in binary flag.CharSet - CF File CharSet Encoding to use.CheckCharSetFlag - Check the charset.public boolean removeFile(string filename)
filename - The absolute path to the file.public string ripExtension(string filename)
filenamepublic void saveFile(any FileToSave, any FileContents, [string CharSet='utf-8'], [boolean CheckCharSetFlag='false'])
FileToSave - The absolute path to the file.FileContents - The file contentsCharSet - CF File CharSet Encoding to use.CheckCharSetFlag - Check the charset.public void sendFile([any file=''], [string name=''], [string mimeType=''], [string disposition='attachment'], [boolean abortAtEnd='false'], [string extension=''], [string deleteFile='false'])
file - The absolute path to the file or a binary filename - The name to send the file to the browser. If not sent in, it will use the name of the file or a UUID for a binary filemimeType - A valid mime type to use. If not sent in, we will try to use a default one according to file extensiondisposition - The browser content disposition (attachment/inline)abortAtEnd - Do an abort after content sendingextension - Only used if file is binary. e.g. jpg or gifdeleteFile - Delete the file after sending. Only used if file is not binarypublic any uploadFile(string fileField, string destination, [string nameConflict='makeunique'], [string accept=''], [string attributes='Normal'], [string mode='755'])
fileField - The name of the form field used to select the filedestination - The absolute path to the destination.nameConflict - Action to take if filename is the same as that of a file in the directory.accept - Limits the MIME types to accept. Comma-delimited list.attributes - Comma-delimitted list of window file attributesmode - The mode of the file for Unix systems, the default is 755
|
ColdBox Platform - WireBox Version 1.1.1 | ||||
| FRAMES | |||||