Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4042593

java.io.File delete should work with non-canonical pathnames

    XMLWordPrintable

    Details

    • Subcomponent:
    • Resolved In Build:
      b01
    • CPU:
      x86
    • OS:
      windows_95
    • Verification:
      Verified

      Backports

        Description



        Name: akC57697 Date: 04/02/97



        The java.io.File delete() does not work properly with non-canonical
        pathnames.The method should convert given pathname to canonical one,
        then delete.
                                          
        ______________________ TestDelNeg.java _________________________________
        import java.awt.*;
        import java.io.*;
        public class TestDelNeg {
          public static void main(String[] args){

              try {
               File f1=new File("\\c:\\DelDir");

               System.out.println("Create:"+f1.mkdir());
               System.out.println("Does it exist as directory ? :"+f1.exists()+" "+f1.isDirectory());
               System.out.println("Delete:"+f1.delete());
              } catch (Exception e) {System.out.println("Unexpected "+e);}
         }
        }
        ______________________ Output ________________________________________
        Create:true
        Does it exist as directory ? :true true
        Delete:false
        ______________________________________________________________________
        ======================================================================

          Attachments

            Issue Links

              Activity

                People

                Assignee:
                mmcclosksunw Michael Mccloskey (Inactive)
                Reporter:
                akuzminorcl Alexander Kuzmin (Inactive)
                Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                  Dates

                  Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: