Using Spring `RestTemplate` for the first time. Is there an easy way to get the list of filenames contained in a directory using Spring `RestTemplate` ? Is RestTemplate appropriate to the goal ?
TO get a specific file (filename), I would do sth like
But this time I simply would want the list of filenames contained in the directory url "https://myrepo.com/" . Which of the methods in the `RestTemplate` API woudld allow me to do so ?
Its not ftp its HTTP. Unless you have a rest endpoint available on your repo that will return the listing you are out of luck. If you can make a simple HTTP GET in your browser and see the listing then the same will work with the Rest Template but most likely that result will be HTML where the Rest Template is generally used with XML or JSON payloads. You could treat the HTML as a string and parse what you want out I suppose but that is a bit Kludgy.
Yes, an HTTP GET on the browser shows the content of the directory.
I guess RestTemplate is not appropriate, as you say. I will have to find a different solution.
"""
the same will work with the Rest Template but most likely that result will be HTML where the Rest Template is generally used with XML or JSON payloads. You could treat the HTML as a string and parse what you want out I suppose but that is a bit Kludgy.