Code example for FileNotFoundException

    // if the requested file does not exist, throw an exception formerly the 
    // Error page from the server was returned if the requested file was 
    // text/html this has changed to return FileNotFoundException for all 
    // file types 
    if (getResponseCode() >= HTTP_BAD_REQUEST) {
      throw new FileNotFoundException(url.toString());
    InputStream result = response.getResponseBodyBytes();
    if (result == null) {
      throw new ProtocolException("No response body exists; responseCode=" + getResponseCode());
    return result;
  @Override public final OutputStream getOutputStream() throws IOException {
    BufferedSink sink = httpEngine.getBufferedRequestBody();
    if (sink == null) {