code: private void deleteEmptyFileOnException(OutputStream outputStream, String path) {
          try {
              outputStream.close();
              File fileToDelete = new File(path);
              fileToDelete.delete();
          }
          catch (Exception e) {
              // Best effort delete.
          }
      }
docs: Helper to delete an empty file in the case of an exception
  
  @param outputStream
  @param path
  @throws IOException