Perhaps the question is, how do you measure an arbitrary number of photons without destroying the system? It's certainly the case that somehow measuring the number of photons in the cavity would collapse the state into a Fock state, but it's not obvious how to do that without actively destroying the system in some way; there has been some work done in non-destructively measuring single photons within a cavity (c.f. Reiserer, et al. 2013) but little with directly measuring arbitrary ensembles non-destructively, which appears impossible with the method introduced in the paper.
It should be noted that the current approaches to creating Fock states involve the strong coupling of an atom or quantum dot with a cavity and passing some squeezed state $a|\alpha\rangle = \alpha |\alpha\rangle$ into the system; here, the nonlinearities introduced by the atom-cavity interactions reject states that aren't particular Fock states. This is often taught in a first course in cavity QED as an application of strong interactions between a two-level system coupled with a cavity, but there has been some recent work in applications of these systems (c.f. Vuckovic, et al 2007.) to other problems.
Overall, while measuring the number of photons in a system without destroying it would certainly collapse it into a particular Fock state, there are easier methods---not to mention that you'd probably be awarded a Nobel prize for being able to non-destructively do so.