All Downloads are FREE. Search and download functionalities are using the official Maven repository.

de.jwic.controls.chart.api.util.ChartHelper Maven / Gradle / Ivy

There is a newer version: 5.3.43
Show newest version
package de.jwic.controls.chart.api.util;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;

/**
 * 
 * @author Karolina Marek (karolina-marek.eu)
 *
 * @date 09.12.2015
 */
public class ChartHelper {
	public static String getFileContent(String fileName) {
		StringBuilder contentBuilder = new StringBuilder();
		if (fileName != null) {
			File file = new File(fileName);
			if (file != null && file.exists()) {
				try {
					BufferedReader in = new BufferedReader(new FileReader(
							fileName));
					String str;
					while ((str = in.readLine()) != null) {
						contentBuilder.append(str);
					}
					in.close();
				} catch (IOException e) {
				}
				String content = contentBuilder.toString();
				return content;
			} else {
				return "";
			}
		}
		return null;
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy