code: private static StartupEntry readFile(String filename, String context, MessageHandler mh) {
          if (filename != null) {
              try {
                  byte[] encoded = Files.readAllBytes(toPathResolvingUserHome(filename));
                  return new StartupEntry(false, filename, new String(encoded),
                          LocalDateTime.now().format(DateTimeFormatter.ofLocalizedDateTime(FormatStyle.MEDIUM)));
              } catch (AccessDeniedException e) {
                  mh.errormsg("jshell.err.file.not.accessible", context, filename, e.getMessage());
              } catch (NoSuchFileException e) {
                  String resource = getResource(filename);
                  if (resource != null) {
                      // Not found as file, but found as resource
                      return new StartupEntry(true, filename, resource);
                  }
                  mh.errormsg("jshell.err.file.not.found", context, filename);
              } catch (Exception e) {
                  mh.errormsg("jshell.err.file.exception", context, filename, e);
              }
          } else {
              mh.errormsg("jshell.err.file.filename", context);
          }
          return null;
  
      }
docs: Read a external file or a resource.
  
  @param filename file/resource to access
  @param context printable non-natural language context for errors
  @param mh handler for error messages
  @return file as startup entry, or null when error (message has been printed)