Save the settings to a file. Called on each change of {@code ignored} list
761525
@Override
    public synchronized void save() {
        if (BulkChange.contains(this)) {
            return;
        }
        try {
            getConfigFile().write(this);
            SaveableListener.fireOnChange(this, getConfigFile());
        } catch (IOException e) {
            LOGGER.error("{}", e);
        }
    }
1018138
public synchronized void save(String persistence) {
		try {
			createObjectMapper().writeValue(new File(persistence), tableList);
		} catch (IOException e) {
			e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
		}
	}
226136
def apply_and_save(self):
        """"""
        patches = self.patches

        content = None
        with open(self.IN_PATH) as f_in:
            # As setup.py.in file size is 2.4 KByte.
            # it's fine to read entire content.
            content = f_in.read()

        # Replace words.
        for key in self.replaced_word_dict:
            content = content.replace(key, self.replaced_word_dict[key])

        # Apply patches.
        out_patches = []
        for patch in patches:
            pattern = re.compile(patch['src'], re.MULTILINE)
            (content, subs_num) = re.subn(pattern, patch['dest'],
                                          content)
            if subs_num > 0:
                patch['applied'] = True
            out_patches.append(patch)

        for patch in out_patches:
            if patch.get('required') and not patch.get('applied'):
                Log.warn('Patch not applied {0}'.format(patch['src']))

        with open(self.OUT_PATH, 'w') as f_out:
            f_out.write(content)

        self.pathces = out_patches
        # Release content data to make it released by GC quickly.
        content = None
949514
private void save() {
		int resp = saveChooser.showSaveDialog(this);
		if (resp == JFileChooser.APPROVE_OPTION) {
			File out = saveChooser.getSelectedFile();
			
			ArrayList list = new ArrayList();
			for (int i=0;i<sprites.size();i++) {
				list.add(sprites.elementAt(i));
			}
			
			try {
				int b = ((Integer) border.getValue()).intValue();
				pack.packImages(list, twidth, theight, b, out);
			} catch (IOException e) {
				// shouldn't happen 
				e.printStackTrace();
				JOptionPane.showMessageDialog(this, "Failed to write output");
			}
		}
	}
27640
def _persist(self):
        """"""
        with open(self.file, 'w') as f:
            json.dump({
                'client': self.client,
                'creds': self.creds,
                'config': self.config
            }, f)
581859
void fileWritten() throws ConfigurationPersistenceException {
        if (!doneBootup.get() || interactionPolicy.isReadOnly()) {
            return;
        }
        try {
            FilePersistenceUtils.copyFile(mainFile, lastFile);
        } catch (IOException e) {
            throw ControllerLogger.ROOT_LOGGER.failedToBackup(e, mainFile);
        }
    }
706538
def save(self):
        """"""
        logger.debug("User requested to save settings. New settings: " + self._settings_str())
        cm.ConfigManager.SETTINGS[cm.PROMPT_TO_SAVE] = not self.autosave_checkbox.isChecked()
        cm.ConfigManager.SETTINGS[cm.SHOW_TRAY_ICON] = self.show_tray_checkbox.isChecked()
        # cm.ConfigManager.SETTINGS[cm.MENU_TAKES_FOCUS] = self.allow_kb_nav_checkbox.isChecked()
        cm.ConfigManager.SETTINGS[cm.SORT_BY_USAGE_COUNT] = self.sort_by_usage_checkbox.isChecked()
        cm.ConfigManager.SETTINGS[cm.UNDO_USING_BACKSPACE] = self.enable_undo_checkbox.isChecked()
        cm.ConfigManager.SETTINGS[cm.NOTIFICATION_ICON] = self.system_tray_icon_theme_combobox.currentData(Qt.UserRole)
        # TODO: After saving the notification icon, apply it to the currently running instance.
        self._save_autostart_settings()
978700
public synchronized void save() throws IOException {
        if(BulkChange.contains(this))   return;

        long start=0;
        if(logger.isLoggable(Level.FINE))
            start = System.currentTimeMillis();

        File file = getFingerprintFile(md5sum);
        save(file);
        SaveableListener.fireOnChange(this, getConfigFile(file));

        if(logger.isLoggable(Level.FINE))
            logger.fine("Saving fingerprint "+file+" took "+(System.currentTimeMillis()-start)+"ms");
    }
681253
def save(self):
        
        l = []
        h = {}
        s = {}
        h_r = {}

        idx = 0
        for i in self.map_list.get_obj():
            length = 0

            if isinstance(i, list):
                for j in i:
                    if isinstance(j, AnnotationsDirectoryItem):
                        if idx % 4 != 0:
                            idx = idx + (4 - (idx % 4))

                    l.append(j)

                    c_length = j.get_length()
                    if isinstance(j, StringDataItem):
                        c_length += 1
                    h[j] = idx + length
                    h_r[idx + length] = j
                    s[idx + length] = c_length

                    length += c_length
                    #debug("SAVE" + str(j) + " @ 0x%x" % (idx+length))

                debug("SAVE " + str(i[0]) + " @0x%x (%x)" % (idx, length))

            else:
                if isinstance(i, MapList):
                    if idx % 4 != 0:
                        idx = idx + (4 - (idx % 4))

                l.append(i)
                h[i] = idx
                h_r[idx] = i

                length = i.get_length()

                s[idx] = length

                debug("SAVE " + str(i) + " @0x%x (%x)" % (idx, length))

            idx += length

        self.header.file_size = idx

        for i in l:
            idx = h[i]
            i.set_off(idx)
            if isinstance(i, CodeItem):
                last_idx = idx
                for j in i.get_obj():
                    j.set_off(last_idx)
                    #j.set_debug_info_off(0)
                    last_idx += j.get_size()

        last_idx = 0
        buff = ""
        for i in l:
            idx = h[i]

            if idx != last_idx:
                debug("Adjust alignment @%x with 00 %x" % (idx, idx - last_idx))
                buff += "\x00" * (idx - last_idx)

            buff += i.get_raw()
            if isinstance(i, StringDataItem):
                buff += "\x00"
            last_idx = idx + s[idx]

        debug("GLOBAL SIZE %d" % len(buff))

        return self.fix_checksums(buff)
513830
private void save(OneOrOther<File, Path> configFile) throws IOException {
		if (configFile.isOne()) {
			File config = configFile.getOne();
			this.saveToWriter(getFileWriter(config));
		} else {
			Path config = configFile.getOther();
			this.saveToWriter(getPathWriter(config));
		}
	}
1114208
def save(self):
        
        if self.filename is None:
            raise StoreException("Filename must be set to write store to disk")

        # We need an atomic way of re-writing the settings, we also need to
        # prevent only overwriting part of the settings file (see bug #116).
        # Create a temp file and only then re-name it to the config
        filename = "{filename}.{date}.tmp".format(
            filename=self.filename,
            date=datetime.datetime.utcnow().strftime('%Y-%m-%dT%H_%M_%S.%f')
        )

        # The `open` built-in doesn't allow us to set the mode
        mode = stat.S_IRUSR | stat.S_IWUSR  # 0600
        fd = os.open(filename, os.O_WRONLY | os.O_CREAT, mode)
        fout = os.fdopen(fd, "w")
        fout.write(json.dumps(self.export()))
        fout.close()

        # Now we should remove the old config
        if os.path.isfile(self.filename):
            os.remove(self.filename)

        # Now rename the temp file to the real config file
        os.rename(filename, self.filename)
524726
def sync(self):
        
        if self._customFormat:
            self._customFormat.save(self.fileName())
        else:
            super(XSettings, self).sync()
106291
public static void save( File f, Application app ) throws IOException {

		Properties properties = new Properties();
		if( ! Utils.isEmptyOrWhitespaces( app.getDisplayName()))
			properties.setProperty( APPLICATION_NAME, app.getDisplayName());

		if( ! Utils.isEmptyOrWhitespaces( app.getDescription()))
			properties.setProperty( APPLICATION_DESCRIPTION, app.getDescription());

		if( app.getTemplate() != null ) {
			if( ! Utils.isEmptyOrWhitespaces( app.getTemplate().getName()))
				properties.setProperty( APPLICATION_TPL_NAME, app.getTemplate().getName());

			if( ! Utils.isEmptyOrWhitespaces( app.getTemplate().getVersion()))
				properties.setProperty( APPLICATION_TPL_VERSION, app.getTemplate().getVersion());
		}

		Utils.writePropertiesFile( properties, f );
	}
970420
def restoreSettings(self, settings):
        
        value = unwrapVariant(settings.value('recent_files'))
        if value:
            self.setFilenames(value.split(os.path.pathsep))
396451
def Save(self):
        """"""
        # This method is intercepted to allow ui_sync
        if self._file_to_save_on_Save:
            self._iopticalsystem.SaveAs(self._file_to_save_on_Save)
        else:
            self._iopticalsystem.Save()
178011
public void saveSettings(Map<String, String> settings) throws Exception {

        for (Map.Entry<String, String> entry : settings.entrySet()) {
            String key = entry.getKey();
            String value = entry.getValue();
            saveSetting(key, value);
        }
        m_currentPreferences.save(m_cms);
        CmsWorkplace.updateUserPreferences(m_cms, m_request);
    }
442804
def save(self):
        
        with open(self.config_file, "w") as f:
            f.write(dump(self.config, default_flow_style=False))