String (@NotNull final PsiDirectory directory, final boolean presentable) { final PsiPackage aPackage = JavaDirectoryService.getInstance().getPackage(directory); if (aPackage != null) { final String qualifiedName = aPackage.getQualifiedName(); if (!qualifiedName.isEmpty()) return qualifiedName; if (presentable) { return JavaBundle.message("default.package.presentable.name") + " (" + directory.getVirtualFile().getPresentableUrl() + ")"; } return ""; } return presentable ? StringUtil.notNullize(FileUtil.getLocationRelativeToUserHome(directory.getVirtualFile().getPresentableUrl())) : ""; }