@Test public void testInstalled() { ApplicationFinder f = new LaunchServicesApplicationFinder(); assertTrue(f.isInstalled(new Application("com.apple.Preview", "Preview"))); assertFalse(f.isInstalled(new Application("com.apple.Preview_", "Preview"))); assertFalse(f.isInstalled(Application.notfound)); }
@Override public boolean isInstalled(final Application application) { synchronized(NSWorkspace.class) { if(Application.notfound.equals(application)) { return false; } return NSWorkspace.sharedWorkspace().absolutePathForAppBundleWithIdentifier( application.getIdentifier()) != null; } }
LaunchServicesApplicationFinder implements ApplicationFinder { @Override public boolean isInstalled(final Application application) { synchronized(NSWorkspace.class) { if(Application.notfound.equals(application)) { return false; } return NSWorkspace.sharedWorkspace().absolutePathForAppBundleWithIdentifier( application.getIdentifier()) != null; } } }
LaunchServicesApplicationFinder implements ApplicationFinder { @Override public boolean isInstalled(final Application application) { synchronized(NSWorkspace.class) { if(Application.notfound.equals(application)) { return false; } return NSWorkspace.sharedWorkspace().absolutePathForAppBundleWithIdentifier( application.getIdentifier()) != null; } } LaunchServicesApplicationFinder(); }
LaunchServicesApplicationFinder implements ApplicationFinder { @Override public boolean isInstalled(final Application application) { synchronized(NSWorkspace.class) { if(Application.notfound.equals(application)) { return false; } return NSWorkspace.sharedWorkspace().absolutePathForAppBundleWithIdentifier( application.getIdentifier()) != null; } } LaunchServicesApplicationFinder(); @Override List<Application> findAll(final String filename); @Override Application find(final String filename); @Override Application getDescription(final String search); @Override boolean isInstalled(final Application application); boolean register(final Local application); }
LaunchServicesApplicationFinder implements ApplicationFinder { @Override public boolean isInstalled(final Application application) { synchronized(NSWorkspace.class) { if(Application.notfound.equals(application)) { return false; } return NSWorkspace.sharedWorkspace().absolutePathForAppBundleWithIdentifier( application.getIdentifier()) != null; } } LaunchServicesApplicationFinder(); @Override List<Application> findAll(final String filename); @Override Application find(final String filename); @Override Application getDescription(final String search); @Override boolean isInstalled(final Application application); boolean register(final Local application);  }