url.readEntireTextStream returns a string even when file is not found

url.readEntireTextStream gives me the following if a file is not found.
The Docs say it should return an empty string but I get XML returned in the String…

</style>
</head>
<body>
<div id="header"><h1>Server Error</h1></div>
<div id="content">
 <div class="content-container"><fieldset>
  <h2>404 - File or directory not found.</h2>
  <h3>The resource you are looking for might have been removed, had its name changed, or is temporarily unavailable.</h3>
 </fieldset></div>
</div>
</body>

Is there a normal why of find out if the file doesn’t exist or a firewall is blocking the URL?
Thanks, I’m new to most Web stuff, as you can probably tell.

It looks like the JUCE side of things is working correctly - that appears to be a response sent by the server.

Have you tried checking the status code? I suspect this will be 404.

1 Like

Thanks for checking, t0m. I forgot I posted this TBH. I suspected from the text that it was an error string from my server. It turns out using a Properties XML instead worked perfectly for what I wanted it for anyway.