Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface File

Hierarchy

  • File

Index

Constructors

Methods

Constructors

constructor

  • References a file. The file does not have to exist.

    Example 1: Get a reference to an existing file

    var myFile = new File( 'PROJECT/bootstrap.js' );
    console.log( myFile.exists );
    // true

    Example 2: Get a reference to a missing file

    var myFile = new File( 'PROJECT/file-to-create.js' );
    console.log( myFile.exists );
    // false

    Parameters

    • path: String

      Absolute path of the file to reference.

    Returns WAKFileInstance

  • References a file. The file does not have to exist.

    Example 1: Get a reference to an existing file

    var myFolder = new Folder( 'PROJECT/' );
    var myFile = new File( myFolder, 'bootstrap.js' );
    console.log( myFile.exists );
    // true

    Example 2: Get a reference to a missing file

    var myFolder = new Folder( 'PROJECT/' );
    var myFile = new File( myFolder, 'file-to-create.js' );
    console.log( myFile.exists );
    // false

    Parameters

    • folder: WAKFolderInstance

      Folder containing the file

    • fileName: String

      Name of the file to reference in the folder path

    Returns WAKFileInstance

Methods

isFile

  • isFile(path: String): Boolean
  • Check if the path references a file.

    var myIsFile = File.isFile( 'PROJECT/bootstrap.js' );
    console.log( myIsFile );
    // true

    Parameters

    • path: String

      Absolute path to a file

    Returns Boolean

    true is the path references a file, false otherwise.