com.apple.eio.FileManager Java Examples

The following examples show how to use com.apple.eio.FileManager. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: FileUtils.java    From vis-ui with Apache License 2.0 6 votes vote down vote up
/** Shows given directory in system explorer window. */
@SuppressWarnings("unchecked")
public static void showDirInExplorer (FileHandle dir) throws IOException {
	File dirToShow;
	if (dir.isDirectory()) {
		dirToShow = dir.file();
	} else {
		dirToShow = dir.parent().file();
	}

	if (OsUtils.isMac()) {
		FileManager.revealInFinder(dirToShow);
	} else {
		try {
			// Using reflection to avoid importing AWT desktop which would trigger Android Lint errors
			// This is desktop only, rarely called, performance drop is negligible
			// Basically 'Desktop.getDesktop().open(dirToShow);'
			Class desktopClass = Class.forName("java.awt.Desktop");
			Object desktop = desktopClass.getMethod("getDesktop").invoke(null);
			desktopClass.getMethod("open", File.class).invoke(desktop, dirToShow);
		} catch (Exception e) {
			Gdx.app.log("VisUI", "Can't open file " + dirToShow.getPath(), e);
		}
	}
}
 
Example #2
Source File: AquaImageFactory.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
static String getPathToThisApplication() {
    return java.security.AccessController.doPrivileged(new PrivilegedAction<String>() {
        public String run() {
            return FileManager.getPathToApplicationBundle();
        }
    });
}
 
Example #3
Source File: AquaImageFactory.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
static String getPathToThisApplication() {
    return java.security.AccessController.doPrivileged(new PrivilegedAction<String>() {
        public String run() {
            return FileManager.getPathToApplicationBundle();
        }
    });
}
 
Example #4
Source File: AquaImageFactory.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
static String getPathToThisApplication() {
    return java.security.AccessController.doPrivileged(new PrivilegedAction<String>() {
        public String run() {
            return FileManager.getPathToApplicationBundle();
        }
    });
}
 
Example #5
Source File: AquaImageFactory.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
static String getPathToThisApplication() {
    return java.security.AccessController.doPrivileged(new PrivilegedAction<String>() {
        public String run() {
            return FileManager.getPathToApplicationBundle();
        }
    });
}
 
Example #6
Source File: AquaImageFactory.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
static String getPathToThisApplication() {
    return java.security.AccessController.doPrivileged(new PrivilegedAction<String>() {
        public String run() {
            return FileManager.getPathToApplicationBundle();
        }
    });
}
 
Example #7
Source File: AquaImageFactory.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
static String getPathToThisApplication() {
    return java.security.AccessController.doPrivileged(new PrivilegedAction<String>() {
        public String run() {
            return FileManager.getPathToApplicationBundle();
        }
    });
}
 
Example #8
Source File: AquaImageFactory.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
static String getPathToThisApplication() {
    return java.security.AccessController.doPrivileged(new PrivilegedAction<String>() {
        public String run() {
            return FileManager.getPathToApplicationBundle();
        }
    });
}
 
Example #9
Source File: AquaImageFactory.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
static String getPathToThisApplication() {
    return java.security.AccessController.doPrivileged(new PrivilegedAction<String>() {
        public String run() {
            return FileManager.getPathToApplicationBundle();
        }
    });
}
 
Example #10
Source File: AquaImageFactory.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
static String getPathToThisApplication() {
    return java.security.AccessController.doPrivileged(new PrivilegedAction<String>() {
        public String run() {
            return FileManager.getPathToApplicationBundle();
        }
    });
}
 
Example #11
Source File: AquaImageFactory.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
static String getPathToThisApplication() {
    return java.security.AccessController.doPrivileged(new PrivilegedAction<String>() {
        public String run() {
            return FileManager.getPathToApplicationBundle();
        }
    });
}
 
Example #12
Source File: AquaImageFactory.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
static String getPathToThisApplication() {
    return java.security.AccessController.doPrivileged(new PrivilegedAction<String>() {
        public String run() {
            return FileManager.getPathToApplicationBundle();
        }
    });
}
 
Example #13
Source File: AquaImageFactory.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
static String getPathToThisApplication() {
    return java.security.AccessController.doPrivileged(new PrivilegedAction<String>() {
        public String run() {
            return FileManager.getPathToApplicationBundle();
        }
    });
}
 
Example #14
Source File: AquaImageFactory.java    From jdk8u-dev-jdk with GNU General Public License v2.0 5 votes vote down vote up
static String getPathToThisApplication() {
    return java.security.AccessController.doPrivileged(new PrivilegedAction<String>() {
        public String run() {
            return FileManager.getPathToApplicationBundle();
        }
    });
}
 
Example #15
Source File: MacRevealOperation.java    From pumpernickel with MIT License 4 votes vote down vote up
@Override
public boolean execute(File file) throws FileNotFoundException {
	return FileManager.revealInFinder(file);
}
 
Example #16
Source File: MacMoveToTrashOperation.java    From pumpernickel with MIT License 4 votes vote down vote up
@Override
public boolean execute(File file) throws FileNotFoundException {
	return FileManager.moveToTrash(file);
}