true
if the folder exists at the defined path, false
otherwise.
Folder extension.
Array of Files.
First file found in the folder.
First folder (i.e., subfolder) in the folder.
Array of Folder objects.
Last modification date for the folder.
Name of the folder without the path.
Name of the folder without the extension.
Parent folder of the folder.
Full path of the folder.
true
if the folder is visible, false
otherwise.
Creates a new folder on disk.
var myFolder = new Folder( 'PROJECT/my-created-folder' );
var myResult = myFolder.create();
console.log( myResult );
// true
true
if the folder is well created
Calls callback
function for each file at the first level of the folder.
var folder = new Folder( 'PROJECT/' );
folder.forEachFile( function( file )
{
console.log( file.path );
});
this
var folder = new Folder( 'PROJECT/' );
folder.forEachFile( function( file )
{
console.log( this );
}, {data: 'some-data' } );
// {"data":"some-data"}
Defines the function called for each file
Current file being processed
Defines this
value of the callback
Calls callback
function for each folder at the first level of the folder.
var folder = new Folder( 'PROJECT/' );
folder.forEachFolder( function( folder )
{
console.log( folder.path );
});
this
var folder = new Folder( 'PROJECT/' );
folder.forEachFolder( function( folder )
{
console.log( this );
}, {data: 'some-data' } );
// {"data":"some-data"}
Defines the function called for each folder
Current folder being processed
Defines this
value of the callback
Returns the size of the free space (expressed in bytes) available on the volume where the Folder object is stored.
(default: true
) true
if consider the whole volume, false
if consider only the allowed size for the quota
Returns the absolute URL of the Folder object.
(default: false
) true
if encode the url, false
otherwise.
Returns the total size (expressed in bytes) of the volume where the Folder object is stored.
Calls callback
function for each file in the folder tree (first-level and sub-level folder).
var folder = new Folder( 'PROJECT/' );
folder.parse( function( file, position, folder )
{
console.log( '-----------------------------' );
console.log( file.path );
console.log( position );
console.log( folder.path );
});
this
var folder = new Folder( 'PROJECT/' );
folder.parse( function( file, position, folder )
{
console.log( this );
}, {data: 'some-data' } );
// {"data":"some-data"}
Defines the function called for each folder
Current processed file
Position of the file currently being processed
Folder of the processed file
Defines this
value of the callback
Removes the folder and its content from the disk.
true
if the folder is not here, false
otherwise.
Removes the contents of the folder from the disk.
Rename the folder on disk.
var myFolder = new Folder( 'PROJECT/my-folder' );
// The folder must exists to be renamed
myFolder.create();
// The destination folder name must be free
myFolder.setName( 'my-renamed-folder' );
// myFolder always references the "my-folder" folder
// The referenced folder did not change with the setName() action.
console.log( myFolder.path );
// PROJECT/my-folder
true
if the folder is successfully renamed
Creation date for the folder.