Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
var file = new File(response, rootPath);
if(file.getContentType() === File.TYPE.DIRECTORY) {
folders[file.getPath()] = file;
}
files.addItem(file);
});
// Artificially add the parent folder
var parentPath = PathUtil.getParentPath(self.getCurrentPath());
var parentFolder = folders[parentPath];
if(parentFolder) {
files.addItem(parentFolder);
}
// Sort
files.sort(File.COMPARATOR);
return files;
};