🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.language
Article #17662

File Delete problem

#17662
From: Oleg Yevteyev
Date: Thu, 15 Oct 1998 00:00
38 lines
1702 bytes
I am trying to delete a file from  server side of applet, using ( for now)
the applet viewer only.
Cannot do it, Question is why?

private boolean file_delete() {
    boolean ret_value;
    ret_value=true;
    String fname= new String();
      try {
          fname=table_diff.getString("TABLE_NAME") ;            //  returns
"MAKES"
          String fpath= this.getCodeBase().getFile();
          String full_name=fname+".sql" ;
          File script= new File(fpath,full_name);
          if (script.exists()) {
            try {script.delete();}                                  //
always fails
            catch (SecurityException se){
              ErrorMessage(se.getMessage().trim());   // Custom error
message
              return false;   }
          }
      }
      catch (Exception e) {
      ErrorMessage(e.getMessage());          // Custom error message
      return false;
      }
    return ret_value;
  }

the error message is always null, file always exists
the path to the file in debugger worries me
it is "/\\\C:\Jbuilder2\myclasses/\MAKES.sql",
but exists() function finds it, so why I cannot delete a file with this path
and
why the SecurityException message is always null.

Thanks in advance.
Technical Details
Message-ID: <7068tb$pus2@forums.borland.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f74b3,638617191d14dca1,start
X-Google-Attributes: gidf74b3,public
From: "Oleg Yevteyev" <oleg@interjetnet.net>
Subject: File Delete problem
Date: 1998/10/15
Message-ID: <7068tb$pus2@forums.borland.com>
X-Deja-AN: 401585858
Organization: Another Netscape Collabra Server User
X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3155.0
Newsgroups: borland.public.jbuilder.java.language