jdk/src/share/classes/javax/swing/filechooser/FileSystemView.java
changeset 23697 e556a715949f
parent 23010 6dadb192ad81
child 24499 9c83666ebd5e
equal deleted inserted replaced
23696:7deff68428ef 23697:e556a715949f
     1 /*
     1 /*
     2  * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.  Oracle designates this
     7  * published by the Free Software Foundation.  Oracle designates this
   577      */
   577      */
   578     protected File createFileSystemRoot(File f) {
   578     protected File createFileSystemRoot(File f) {
   579         return new FileSystemRoot(f);
   579         return new FileSystemRoot(f);
   580     }
   580     }
   581 
   581 
   582 
   582     @SuppressWarnings("serial") // Same-version serialization only
   583 
       
   584 
       
   585     static class FileSystemRoot extends File {
   583     static class FileSystemRoot extends File {
   586         public FileSystemRoot(File f) {
   584         public FileSystemRoot(File f) {
   587             super(f,"");
   585             super(f,"");
   588         }
   586         }
   589 
   587 
   773             }
   771             }
   774         }
   772         }
   775         return super.createFileObject(path);
   773         return super.createFileObject(path);
   776     }
   774     }
   777 
   775 
       
   776     @SuppressWarnings("serial") // anonymous class
   778     protected File createFileSystemRoot(File f) {
   777     protected File createFileSystemRoot(File f) {
   779         // Problem: Removable drives on Windows return false on f.exists()
   778         // Problem: Removable drives on Windows return false on f.exists()
   780         // Workaround: Override exists() to always return true.
   779         // Workaround: Override exists() to always return true.
   781         return new FileSystemRoot(f) {
   780         return new FileSystemRoot(f) {
   782             public boolean exists() {
   781             public boolean exists() {