WizardUtils { @NotNull public static File getProjectLocationParent() { String parent = RecentProjectsManager.getInstance().getLastProjectCreationLocation(); if (parent != null) { return new File(PathUtil.toSystemDependentName(parent)); } String defaultProjectLocation = GeneralSettings.getInstance().getDefaultProjectDirectory(); if (defaultProjectLocation != null && !defaultProjectLocation.isEmpty()) { return new File(defaultProjectLocation); } String child = ApplicationNamesInfo.getInstance().getFullProductName().replace(" ", "") + "Projects"; return new File(SystemProperties.getUserHome(), child); }  @NotNull static File getProjectLocationParent(); @Nullable static String validatePackageName(@Nullable String packageName); @NotNull static String toHtmlString(@NotNull String text); @NotNull static URL toUrl(@NotNull String urlAsString); static String getUniqueName(String initialValue, Validator<String> validator); static boolean hasComposeMinAgpVersion(@Nullable Project project, @Nullable String templateCategory); static final String COMPOSE_MIN_AGP_VERSION; }
@Test public void defaultProjectLocation() { setRecentProjectLocation(null); setDefaultProjectDirectory(null); assertThat(getProjectLocationParent().getName()).isEqualTo(IdeInfo.getInstance().isAndroidStudio() ? "AndroidStudioProjects" : "IntelliJIDEAProjects"); }
@Test public void defaultProjectLocationSetByUser() { String dpd = "default/project/directory"; setRecentProjectLocation(null); setDefaultProjectDirectory(dpd); File actualLocation = getProjectLocationParent(); assertThat(FileUtil.toSystemIndependentName(actualLocation.toString())).isEqualTo(dpd); }
@Test public void recentProjectLocation() { String rpl = "recent/project/location"; setRecentProjectLocation(rpl); File actualLocation = getProjectLocationParent(); assertThat(FileUtil.toSystemIndependentName(actualLocation.toString())).isEqualTo(rpl); }