This is my code by the way...

  /**
   * adds a file parameter to the request
   * @param name parameter name
   * @param filename the name of the file
   * @param is input stream to read the contents of the file from
   * @throws IOException
   */
  public void setParameter(String name, String filename, InputStream is)
throws IOException {
    boundary();
    writeName(name);
    write("; filename=\"");
    write(filename);
    write('"');
    newline();
    write("Content-Type: ");
    String type = null;
    type = connection.guessContentTypeFromName(filename);
    if (type == null) type = "application/octet-stream";
    writeln(type);
    newline();
    pipe(is, os);
    newline();
  }

-----Original Message-----
From: Stuart Stephen [mailto:[EMAIL PROTECTED]
Sent: 05 December 2003 11:05
To: Tomcat Users List
Subject: Illegal Access Error [ URLConnection ]


Hi,

When I do URLConnection.guessContentTypeFromName(filename) I get an
IllegalAccessError thrown. Yet, I cannot catch this as the method only
throws an IOException.

Why does this throw an Exception in Tomcat? It doesn't throw it if the
method is called from the command prompt in a static class???

Is it a security exception thrown by tomcat?

Thanks,
Stuart Stephen



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to