private boolean validateValues() {
    final String workspaceName = getWorkspaceName();
    if ("".equals(workspaceName) || workspaceName == null) {
      CMessageBox.showInformation(this, "A workspace need a name.");

      return false;
    }

    final File workspaceDir = new File(getWorkspacePath());
    if (workspaceDir.exists()) {
      if (!workspaceDir.isDirectory()) {
        CMessageBox.showInformation(this, "The specified workspace is not a directory.");

        return false;
      }

      if (workspaceDir.list().length != 0) {
        CMessageBox.showInformation(this, "The specified workspace directory is not empty.");

        return false;
      }
    } else {
      boolean created = false;
      try {
        created = workspaceDir.createNewFile();
      } catch (final IOException e) {
        CMessageBox.showError(
            this,
            String.format(
                "Could create workspace directory. '%s'", workspaceDir.getAbsolutePath()));

        return false;
      } finally {
        if (created) {
          workspaceDir.delete();
        }
      }

      return created;
    }

    return true;
  }
Dialog for creating new BinDiff workspaces.
java/ui/src/main/java/com/google/security/zynamics/bindiff/gui/dialogs/NewWorkspaceDialog.java