function getDirectoryPath(fullPath) {
        return fullPath.substr(0, fullPath.lastIndexOf("/") + 1);
    }
Get the parent directory of a file. If a directory is passed, the SAME directory is returned.
@param {string} fullPath full path to a file or directory
@return {string} Returns the path to the parent directory of a file or the path of a directory,
                 including trailing "/"