Java FileWriter Write save(List list, String REPO)

Here you can find the source of save(List list, String REPO)

Description

DOCUMENT ME!

License

Open Source License

Declaration

public static void save(List<String> list, String REPO) 

Method Source Code

//package com.java2s;
/*//from  w  w  w  .  j a va 2s. c  o m
 * :mode=java:tabSize=4:indentSize=4:noTabs=true:
 * :folding=indent:collapseFolds=0:wrap=none:maxLineLen=120:
 *
 * $Source: /var/lib/cvsd/cvsrepo/invasion/nw/nexusbot/src/nexusbot/Utils.java,v $
 * Copyright (C) 2007 Jeffrey Hoyt
 *
 * This program 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 2
 * of the License, or any later version.
 *
 * This program 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 this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 */

import java.io.*;

import java.util.*;

public class Main {
    public final static String NEWLINE = System.getProperty("line.separator");

    /**
     * DOCUMENT ME!
     */
    public static void save(List<String> list, String REPO) {
        try {
            FileWriter out = new FileWriter(REPO);
            for (String s : list) {
                out.write(s);
                out.write(NEWLINE);
            }
            out.close();
        } catch (IOException e) {
            System.err.println("Things not going as planned.");
            e.printStackTrace();
        } // catch
    }
}

Related

  1. save(File file, String content)
  2. save(File file, String text)
  3. save(File pFile, String pString)
  4. save(final String content, final String file)
  5. save(Map map, String path)
  6. save(String fileName, Object o)
  7. save(String fileName, String dataToSave)
  8. save(String modelo, String filename)