code: protected Reader toReader(Object input) throws IOException {
          if (input instanceof Reader) {
              return (Reader) input;
          }
  
          if (input instanceof InputStream) {
              return new InputStreamReader((InputStream) input);
          }
  
          if (input instanceof String) {
              return new StringReader((String) input);
          }
  
          if (input instanceof URL) {
              return new InputStreamReader(((URL) input).openStream());
          }
  
          if (input instanceof File) {
              return new FileReader((File) input);
          }
  
          throw new IllegalArgumentException("Unable to turn " + input + " into reader");
      }
docs: Turns input into a Reader.
  
  @param input A {@link Reader}, {@link java.io.InputStream}, {@link File}, or {@link
  Resource}.