// Assume directory is a absolute path first:
     let appsDir = new FileUtils.File(directory);
     if (!appsDir.exists()) {
         // Assume directory is a subdirectory of GAIA_DIR
         ....
     }