Class: FileUtils

FileUtils()

File Utilities

Constructor

new FileUtils()

Source:

Methods

(static) getExtensionFromFileName(fileName)

Return the extension of a filename.
Parameters:
Name Type Description
fileName The file name
Source:
Returns:
File name extension

(static) getFileNameWithoutExtension(fileName)

Return a filename without extension
Parameters:
Name Type Description
fileName The file name
Source:
Returns:
File name without extension

(async, static) getInstance(type, param)

Parameters:
Name Type Description
type The file class type string (ie: 'JsFile')
param The file constructor parameter
Source:
Returns:
A file object (ie: JsFile)

(static) isAudio(filename)

Detect if filename is an audio file.
Parameters:
Name Type Description
filename The filename.
Source:
Returns:
True if audio file.

(static) isImage(filename)

Detect if filename is an image file.
Parameters:
Name Type Description
filename The filename.
Source:
Returns:
True if image file.

(static) isPdf(filename)

Detect if filename is a pdf file.
Parameters:
Name Type Description
filename The file name
Source:
Returns:
True if pdf

(static) isText(filename)

Detect if filename is a text file.
Parameters:
Name Type Description
filename The filename.
Source:
Returns:
True if text file.

(static) isVideo(filename)

Detect if filename is a video file.
Parameters:
Name Type Description
filename The filename.
Source:
Returns:
True if video file.