Java FileWriter Write saveDotGraph(final String dotGraph, final File outputDirectory)

Here you can find the source of saveDotGraph(final String dotGraph, final File outputDirectory)

Description

Save the specified Graphviz's dot file at the top of the specified project.

License

Open Source License

Parameter

Parameter Description
dotGraph a parameter
outputDirectory a parameter

Exception

Parameter Description
IOException an exception

Declaration

private static File saveDotGraph(final String dotGraph, final File outputDirectory) throws IOException 

Method Source Code


//package com.java2s;
/*//ww w . ja va 2s.c  o m
 * Copyright 2012 jccastrejon
 *  
 * This file is part of ExSchema.
 *
 * ExSchema is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * any later version.
 *
 * ExSchema is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
    
 * You should have received a copy of the GNU General Public License
 * along with ExSchema. If not, see <http://www.gnu.org/licenses/>.
 */

import java.io.File;
import java.io.FileWriter;
import java.io.IOException;

public class Main {
    /**
     * Save the specified Graphviz's dot file at the top of the specified
     * project.
     * 
     * @param dotGraph
     * @param outputDirectory
     * @return
     * @throws IOException
     */
    private static File saveDotGraph(final String dotGraph, final File outputDirectory) throws IOException {
        File returnValue;
        FileWriter fileWriter;

        // Output content
        returnValue = new File(outputDirectory, "schemas.dot");
        fileWriter = new FileWriter(returnValue, false);
        fileWriter.write(dotGraph);
        fileWriter.close();

        return returnValue;
    }
}

Related

  1. saveContent(String context, String filename)
  2. saveData(Map> data, File file)
  3. saveData(Map> data, String file)
  4. saveData(String fileName, double totalTime, int[] resultSubset)
  5. saveDictionary(String fileName, Map values)
  6. saveDoubleArray2File(Double[] doubleArray, String fileName)
  7. saveDoubleArray2FileAppend(Double[] doubleArray, String fileName)
  8. saveEasyQuestImpl(final String quest, final File targetFile)
  9. saveFile(File directory, String fileName, String content)