Here you can find the source of getFileContents(File methodPatch)
Parameter | Description |
---|---|
methodPatch | a parameter |
public static String getFileContents(File methodPatch)
//package com.java2s; import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.util.Scanner; public class Main { /**/*from w w w.ja va2s . co m*/ * @param methodPatch * @return */ public static String getFileContents(File methodPatch) { Scanner file; try { file = new Scanner(new FileInputStream(methodPatch)); StringBuilder out = new StringBuilder(); while (file.hasNext()) { out.append(file.next()); } return out.toString(); } catch (FileNotFoundException e) { // TODO Auto-generated catch block e.printStackTrace(); return ""; } } }