Save to the file the model.

@param file
file
@param dajlabModel
model
171326
public static void saveModel(final File file, final DajlabModel dajlabModel) {

		Platform.runLater(new Runnable() {
			@Override
			public void run() {
				Gson fxGson = FxGson.fullBuilder().setPrettyPrinting().create();

				JsonElement el = fxGson.toJsonTree(dajlabModel);
				try {
					JsonWriter w = new JsonWriter(new FileWriter(file));
					w.setIndent("\t");
					fxGson.toJson(el, w);
					w.close();
				} catch (Exception e) {
					logger.error("Unable to export model to file [{}]", file.getName());
					ExceptionFactory.throwDaJLabRuntimeException(DaJLabConstants.ERR_SAVE_MODEL);
				}
			}
		});
	}
1207423
public void writePom(File file) throws ProjectException {
        log.debug("Writing pom: {}", file.getPath());

        Project copy = this;
        copy.removeProperty( "project.basedir" );

        Writer writer;
        try {
            writer = new BufferedWriter(new FileWriter(file));
        } catch (IOException e) {
            throw new ProjectException(e);
        }

        MavenXpp3Writer pomWriter = new MavenXpp3Writer();
        try {
            pomWriter.write(writer, copy.mavenModel);
        } catch (IOException e) {
            throw new ProjectException("Failed to write pom", e);
        }
    }
1329080
public void store(File file) throws IOException {
        try (val s = new FileOutputStream(file, false)) {
            this.properties.store(s, "");
        }
    }
92094
public void save(File file) throws IOException {

        Writer writer = null;

        try {
            writer = new Writer(file);
            writer.println(toPrettyString());
        } finally {
            if (writer != null) writer.close();
        }
    }
626499
public static void doObjToFile(String file, Object[] objs) {
		ObjectOutputStream oos = null;
		try {
			FileOutputStream fos = new FileOutputStream(file);
			oos = new ObjectOutputStream(fos);
			for (int i = 0; i < objs.length; i++) {
				oos.writeObject(objs[i]);
			}
		} catch (Exception e) {
			e.printStackTrace();
		} finally {
			try {
				oos.close();
			} catch (IOException e) {
				e.printStackTrace();
			}
		}
	}
284570
public void saveAs(final File file) throws IOException {
        try {
            final FileOutputStream out = new FileOutputStream(file);
            try {
                this.save(out);
            } finally {
                out.flush();
                out.close();
            }
        } catch (final FileNotFoundException e) {
            this.logger.log(Level.SEVERE, "Can't open " + file, e);
            throw new IOException(e);
        } catch (final NullPointerException e) {
            this.logger.log(Level.SEVERE, "No file", e);
            throw new IOException(e);
        }
    }
1098890
public void storeAs(File file) throws IOException
    {
        try (FileOutputStream fos = new FileOutputStream(file);
                OutputStreamWriter osw = new OutputStreamWriter(fos, UTF_8);
                BufferedWriter bw = new BufferedWriter(osw))
        {
            store(bw);
        }
    }
1182921
public void save(File... files) throws IOException {
        Nd4j.saveBinary(getMin(), files[0]);
        Nd4j.saveBinary(getMax(), files[1]);
        if (isFitLabel()) {
            Nd4j.saveBinary(getLabelMin(), files[2]);
            Nd4j.saveBinary(getLabelMax(), files[3]);
        }
    }
701042
public void writeSBGN(Model model, String file) {
		// Create the model
		Sbgn sbgn = createSBGN(model);

		// Write in file
		try {
			SbgnUtil.writeToFile(sbgn, new File(file));
		}
		catch (JAXBException e) {
			throw new RuntimeException("writeSBGN, SbgnUtil.writeToFile failed", e);
		}
	}
1319722
public static void writeObjectToFile(File file, Object object) throws IOException {
    FileOutputStream fs = new FileOutputStream(file);
    ObjectOutputStream os = new ObjectOutputStream(fs);
    os.writeObject(object);
    os.close();
  }
24179
@Override
    public void setFile(File file) {
        configFile = file;
        if (tc.isDebugEnabled())
            Tr.debug(tc, "Jaspi configuration of persistent providers will be stored in file: " + file);
    }
156367
@Override
    public synchronized void onFileCreate(File file) {
        final Set<DetectedWebJar> listOfDetectedWebJarLib = isWebJar(file);
        if (listOfDetectedWebJarLib != null) {
            JarFile jar = null;
            try {
                jar = new JarFile(file);
                List<FileWebJarLib> installed = new ArrayList<>();
                for (DetectedWebJar detected : listOfDetectedWebJarLib) {
                    FileWebJarLib lib = expand(detected, jar);
                    if (lib != null) {
                        libs.add(lib);
                        installed.add(lib);
                        LOGGER.info("{} unpacked to {}", lib.name, lib.root.getAbsolutePath());
                    }
                }
                controller.addWebJarLibs(installed);
            } catch (IOException e) {
                LOGGER.error("Cannot open the jar file {}", file.getAbsolutePath(), e);
            } finally {
                IOUtils.closeQuietly(jar);
            }

        }
    }
112555
public void storeFlattened(File file) throws IOException {
        BufferedOutputStream out = new BufferedOutputStream(
                new FileOutputStream(file));
        try {
            storeFlattened(out);
        } finally {
            out.close();
        }
    }
24724
public void saveFile(File file, String type)
   {
      if (file != null)
      {
         m_treeController.saveFile(file, type);
      }
   }
1327898
public static void writeModel(@NonNull Model model, @NonNull File file, boolean saveUpdater) throws IOException {
        writeModel(model,file,saveUpdater,null);
    }
1363079
public static void saveBytes(@NotNull File file, @NotNull byte[] bytes) throws IOException
    {
        FileOutputStream stream = null;
        try {
            stream = new FileOutputStream(file);
            stream.write(bytes);
        } finally {
            if (stream != null) {
                stream.close();
            }
        }
    }
836319
public final void save(File file) throws IOException {
        _entryFile = file;
        Chronos c = new Chronos();
        DataWriter out = new FastDataWriter(file);

        try {
            out.open();

            // Save entry head
            out.writeLong(STORAGE_VERSION); // write the entry file version
            out.writeLong(_minScn);
            out.writeLong(_maxScn);
            out.writeInt(size());

            // Save entry body
            saveDataSection(out);

            // Save entry tail.
            out.writeLong(_minScn);
            out.writeLong(_maxScn);
        } finally {
            out.close();
        }
        
        if(_log.isInfoEnabled()) {
            _log.info("Saved entry: minScn=" + _minScn + " maxScn=" + _maxScn + " size=" + size() + " file=" + file.getName() + " in " + c.getElapsedTime());
        }
    }