@Test public void testFind() { assertNotNull(new ApplicationSupportDirectoryFinder().find()); assertEquals("~/Library/Application Support/Cyberduck", new ApplicationSupportDirectoryFinder().find().getAbbreviatedPath()); }
@Override public Local find() { final NSArray directories = FoundationKitFunctions.library.NSSearchPathForDirectoriesInDomains( FoundationKitFunctions.NSSearchPathDirectory.NSApplicationSupportDirectory, FoundationKitFunctions.NSSearchPathDomainMask.NSUserDomainMask, true); final String application = preferences.getProperty("application.name"); if(directories.count().intValue() == 0) { log.error("Failed searching for application support directory"); return new FinderLocal("~/Library/Application Support", application); } else { final String directory = directories.objectAtIndex(new NSUInteger(0)).toString(); if(log.isInfoEnabled()) { log.info(String.format("Found application support directory in %s", directory)); } final Local folder = new FinderLocal(directory, application); if(log.isDebugEnabled()) { log.debug(String.format("Use folder %s for application support directory", folder)); } return folder; } }
ApplicationSupportDirectoryFinder implements SupportDirectoryFinder { @Override public Local find() { final NSArray directories = FoundationKitFunctions.library.NSSearchPathForDirectoriesInDomains( FoundationKitFunctions.NSSearchPathDirectory.NSApplicationSupportDirectory, FoundationKitFunctions.NSSearchPathDomainMask.NSUserDomainMask, true); final String application = preferences.getProperty("application.name"); if(directories.count().intValue() == 0) { log.error("Failed searching for application support directory"); return new FinderLocal("~/Library/Application Support", application); } else { final String directory = directories.objectAtIndex(new NSUInteger(0)).toString(); if(log.isInfoEnabled()) { log.info(String.format("Found application support directory in %s", directory)); } final Local folder = new FinderLocal(directory, application); if(log.isDebugEnabled()) { log.debug(String.format("Use folder %s for application support directory", folder)); } return folder; } } }
ApplicationSupportDirectoryFinder implements SupportDirectoryFinder { @Override public Local find() { final NSArray directories = FoundationKitFunctions.library.NSSearchPathForDirectoriesInDomains( FoundationKitFunctions.NSSearchPathDirectory.NSApplicationSupportDirectory, FoundationKitFunctions.NSSearchPathDomainMask.NSUserDomainMask, true); final String application = preferences.getProperty("application.name"); if(directories.count().intValue() == 0) { log.error("Failed searching for application support directory"); return new FinderLocal("~/Library/Application Support", application); } else { final String directory = directories.objectAtIndex(new NSUInteger(0)).toString(); if(log.isInfoEnabled()) { log.info(String.format("Found application support directory in %s", directory)); } final Local folder = new FinderLocal(directory, application); if(log.isDebugEnabled()) { log.debug(String.format("Use folder %s for application support directory", folder)); } return folder; } }  }
ApplicationSupportDirectoryFinder implements SupportDirectoryFinder { @Override public Local find() { final NSArray directories = FoundationKitFunctions.library.NSSearchPathForDirectoriesInDomains( FoundationKitFunctions.NSSearchPathDirectory.NSApplicationSupportDirectory, FoundationKitFunctions.NSSearchPathDomainMask.NSUserDomainMask, true); final String application = preferences.getProperty("application.name"); if(directories.count().intValue() == 0) { log.error("Failed searching for application support directory"); return new FinderLocal("~/Library/Application Support", application); } else { final String directory = directories.objectAtIndex(new NSUInteger(0)).toString(); if(log.isInfoEnabled()) { log.info(String.format("Found application support directory in %s", directory)); } final Local folder = new FinderLocal(directory, application); if(log.isDebugEnabled()) { log.debug(String.format("Use folder %s for application support directory", folder)); } return folder; } }  @Override Local find(); }
ApplicationSupportDirectoryFinder implements SupportDirectoryFinder { @Override public Local find() { final NSArray directories = FoundationKitFunctions.library.NSSearchPathForDirectoriesInDomains( FoundationKitFunctions.NSSearchPathDirectory.NSApplicationSupportDirectory, FoundationKitFunctions.NSSearchPathDomainMask.NSUserDomainMask, true); final String application = preferences.getProperty("application.name"); if(directories.count().intValue() == 0) { log.error("Failed searching for application support directory"); return new FinderLocal("~/Library/Application Support", application); } else { final String directory = directories.objectAtIndex(new NSUInteger(0)).toString(); if(log.isInfoEnabled()) { log.info(String.format("Found application support directory in %s", directory)); } final Local folder = new FinderLocal(directory, application); if(log.isDebugEnabled()) { log.debug(String.format("Use folder %s for application support directory", folder)); } return folder; } }  @Override Local find();  }