To quote the law directly-
> After notice and a hearing, the court, on its own motion or on a motion by the United States trustee, trustee (or bankruptcy administrator, if any), or any party in interest, may dismiss a case filed by an individual debtor under this chapter whose debts are primarily consumer debts, or, with the debtor’s consent, convert such a case to a case under chapter 11 or 13 of this title, if it finds that the granting of relief would be an abuse of the provisions of this chapter.
11 U.S.C. § 707(b)(1)