Here you can find the source of loadTemplateParametersFile(File f)
@SuppressWarnings("resource") public static Map<String, String> loadTemplateParametersFile(File f)
//package com.java2s; /*//from ww w . j av a 2s. c o m This file is part of RUbioSeq-GUI. RUbioSeq-GUI 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 (at your option) any later version. RUbioSeq-GUI 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 RUbioSeq-GUI. If not, see <http://www.gnu.org/licenses/>. */ import java.io.BufferedReader; import java.io.File; import java.io.FileNotFoundException; import java.io.FileReader; import java.util.HashMap; import java.util.Map; public class Main { @SuppressWarnings("resource") public static Map<String, String> loadTemplateParametersFile(File f) { Map<String, String> toret = new HashMap<String, String>(); BufferedReader br; try { br = new BufferedReader(new FileReader(f)); } catch (FileNotFoundException e1) { return toret; } if (!f.exists()) { return toret; } try { String line; while ((line = br.readLine()) != null) { String[] parts = line.split(" "); if (parts.length == 4) { String parameterName = parts[0]; String parameterValue = parts[3]; toret.put(parameterName, parameterValue); } } } catch (Exception e) { } return toret; } }