home *** CD-ROM | disk | FTP | other *** search
- package javax.swing.filechooser;
-
- import java.io.File;
- import java.io.IOException;
- import java.lang.reflect.Method;
-
- class GenericFileSystemView extends FileSystemView {
- private static final Object[] noArgs = new Object[0];
- private static final Class[] noArgTypes = new Class[0];
- private static Method listRootsMethod = null;
- private static boolean listRootsMethodChecked = false;
- // $FF: synthetic field
- static Class class$java$io$File;
-
- // $FF: synthetic method
- static Class class$(String var0) {
- try {
- return Class.forName(var0);
- } catch (ClassNotFoundException var2) {
- throw new NoClassDefFoundError(((Throwable)var2).getMessage());
- }
- }
-
- public File createNewFolder(File var1) throws IOException {
- if (var1 == null) {
- throw new IOException("Containing directory is null:");
- } else {
- Object var2 = null;
- File var3 = ((FileSystemView)this).createFileObject(var1, "NewFolder");
- if (var3.exists()) {
- throw new IOException("Directory already exists:" + var3.getAbsolutePath());
- } else {
- var3.mkdirs();
- return var3;
- }
- }
- }
-
- public File[] getRoots() {
- if (!listRootsMethodChecked) {
- try {
- listRootsMethod = (class$java$io$File != null ? class$java$io$File : (class$java$io$File = class$("java.io.File"))).getMethod("listRoots", noArgTypes);
- } catch (NoSuchMethodException var6) {
- } finally {
- listRootsMethodChecked = true;
- }
- }
-
- if (listRootsMethod != null) {
- try {
- File[] var9 = (File[])listRootsMethod.invoke((Object)null, noArgs);
-
- for(int var2 = 0; var2 < var9.length; ++var2) {
- var9[var2] = new FileSystemRoot(var9[var2]);
- }
-
- return var9;
- } catch (Exception var8) {
- ((Throwable)var8).printStackTrace();
- return null;
- }
- } else {
- File[] var1 = new File[0];
- return var1;
- }
- }
-
- public boolean isHiddenFile(File var1) {
- return false;
- }
-
- public boolean isRoot(File var1) {
- if (!var1.isAbsolute()) {
- return false;
- } else {
- String var2 = var1.getParent();
- if (var2 == null) {
- return true;
- } else {
- File var3 = new File(var2);
- return var3.equals(var1);
- }
- }
- }
- }
-