private static void applySettings(VirtualFile file) {
if (file == null || !file.isInLocalFileSystem()) return;
// Get editorconfig settings
final String filePath = file.getCanonicalPath();
final SettingsProviderComponent settingsProvider = SettingsProviderComponent.getInstance();
final List<EditorConfig.OutPair> outPairs = settingsProvider.getOutPairs(filePath);
// Apply trailing spaces setting
final String trimTrailingWhitespace = Utils.configValueForKey(outPairs, trimTrailingWhitespaceKey);
applyConfigValueToUserData(file, TrailingSpacesStripper.OVERRIDE_STRIP_TRAILING_SPACES_KEY,
trimTrailingWhitespaceKey, trimTrailingWhitespace, trimMap);
// Apply final newline setting