Josephson and charging effect in mesoscopic superconducting devices