code: function getTargetFolder(items, allowRoot) {
  			var folder;
  			if (!Array.isArray(items)) {
  				items = [items];
  			}
  			items.some(function(currentItem) {
  				var testFolder;
  				if (currentItem.Directory) {
  					testFolder = currentItem;
  				} else {
  					testFolder = currentItem.parent;
  				}
  				if (testFolder) {
  					folder = testFolder;
  					return true;
  				}
  				return false;
  			});
  			if (!allowRoot && folder && mFileUtils.isAtRoot(folder.Location)) {
  				return null;
  			}
  			return folder;
  		}
docs: /*
  Iterate over an array of items and return the target folder. The target
  folder of an item is either itself (if it is a dir) or its parent. If there
  are multiple target folders, return the first.
  
  If the root folder is allowed, all items need to be directories