We discuss the phenomenon of Bose-Einstein condensation of an ideal nonrela
tivistic Bose gas in an arbitrarily shaped cavity. The influence of the fin
ite extension of the cavity on all thermodynamical quantities, especially o
n the critical temperature of the system, is considered. We use two main me
thods that are shown to be equivalent. The first deals with the partition f
unction as a sum over energy levels and uses a Mellin-Barnes integral repre
sentation to extract an asymptotic formula. The second method converts the
sum over the energy levels to an integral with a suitable density of states
factor obtained from spectral analysis. The application to some simple cav
ities is discussed. [S1063-651X(99)03101-3].