title: how can we write data to a file based on url?
body: <pre><code>try
          {
              URL url = new URL("http://localhost:8080/Files/textfile.txt");
  
              URLConnection connection = url.openConnection();
              connection.setDoOutput(true);
              OutputStream outStream = connection.getOutputStream();
              ObjectOutputStream objectStream = new ObjectOutputStream(outStream);
              objectStream.writeInt(637);
              objectStream.writeObject("Hello there");
              objectStream.writeObject(new Date());
              objectStream.flush();
              objectStream.close();
          }
          catch (Exception e)
          {
              System.out.println(e.toString());
          }
  
  i am unable to write text into the file(textfile.txt) . i dn't know wat the       problem is??  can anyone explain how to write data to a text file based on url information ...  
  </code></pre>