code: public static String readFile( File file ) throws IOException {
          if (!file.exists()) {
              throw new FileNotFoundException("The required projection file is not available: " + file.getAbsolutePath());
          }
          try (BufferedReader br = new BufferedReader(new FileReader(file))) {
              StringBuilder sb = new StringBuilder(200);
              String line;
              while( (line = br.readLine()) != null ) {
                  sb.append(line);
                  sb.append("\n"); //$NON-NLS-1$
              }
              return sb.toString();
          }
      }
docs: Read text from a file in one line.
  
  @param file the file to read.
  
  @return the read string.
  
  @throws IOException