test_class.file: services/src/test/java/com/greensopinion/finance/services/persistence/DataDirectoryLocatorTest.java
test_class.identifier: DataDirectoryLocatorTest
test_case.body: @Test
  	public void getDataDirectory() {
  		File file = new DataDirectoryLocator().locate();
  		if (isMac()) {
  			assertEquals(System.getProperty("user.home") + "/Library/Application Support/GreensOpinionFinance",
  					file.getPath());
  		} else if (isWindows()) {
  			assertEquals(System.getProperty("user.home") + "\\AppData\\Roaming\\GreensOpinionFinance", file.getPath());
  		} else {
  			fail("Unsupported os: " + System.getProperty("os.name"));
  		}
  		assertTrue(file.getParentFile().exists());
  		assertTrue(file.getParentFile().isDirectory());
  	}
test_case.class_method_signature: DataDirectoryLocatorTest.getDataDirectory()
test_case.full_signature: @Test public void getDataDirectory()
test_case.identifier: getDataDirectory
test_case.invocations: locate isMac assertEquals getProperty getPath isWindows assertEquals getProperty getPath fail getProperty assertTrue exists getParentFile assertTrue isDirectory getParentFile
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void getDataDirectory()
focal_class.declarator: APP_DIR = "GreensOpinionFinance"
focal_class.modifier: private static final
focal_class.original_string: private static final String APP_DIR = "GreensOpinionFinance";
focal_class.type: String
focal_class.var_name: APP_DIR
focal_class.file: services/src/main/java/com/greensopinion/finance/services/persistence/DataDirectoryLocator.java
focal_class.identifier: DataDirectoryLocator
focal_class.class_method_signature: DataDirectoryLocator.locate()
focal_class.full_signature: public File locate()
focal_class.identifier: locate
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: File
focal_class.signature: File locate()
focal_method.body: public File locate() {
  		String os = System.getProperty("os.name").toLowerCase(Locale.ENGLISH);
  		String path;
  		if (os.contains("mac")) {
  			path = System.getProperty("user.home") + "/Library/Application Support/" + APP_DIR;
  		} else if (os.contains("windows")) {
  			String appData = System.getenv("APPDATA");
  			if (Strings.isNullOrEmpty(appData)) {
  				appData = System.getProperty("user.home") + "AppData\\Roaming";
  			}
  			path = appData + "\\" + APP_DIR;
  		} else {
  			throw new IllegalStateException(os);
  		}
  		if (Demo.isEnabled()) {
  			path += "-demo";
  		}
  		return new File(path);
  	}
focal_method.class_method_signature: DataDirectoryLocator.locate()
focal_method.full_signature: public File locate()
focal_method.identifier: locate
focal_method.invocations: toLowerCase getProperty contains getProperty contains getenv isNullOrEmpty getProperty isEnabled
focal_method.modifiers: public
focal_method.parameters: ()
focal_method.return: File
focal_method.signature: File locate()