code: private String getContentFromPath(String sourcePath,
              HostsSourceType sourceType) throws IOException {
  
          String res = "";
  
          if (sourceType == HostsSourceType.LOCAL_FILE) {
              res = PcFileNetworkIoUtils.readFileContentToString(sourcePath);
          } else if (sourceType == HostsSourceType.URL) {
              res = PcFileNetworkIoUtils.readStringFromUrlGeneric(sourcePath);
          }
          return res;
  
      }
docs: note that for read from file, this will just load all to memory. not fit
  if need to read a very large file. However for getting the host name.
  normally it is fine.
  
  for reading large file, should use iostream.
  
  @param sourcePath
  the source path
  @param sourceType
  the source type
  @return the content from path
  @throws IOException
  Signals that an I/O exception has occurred.