public static void setQuota ( final GreenMailUser user , final Quota quota ) { Session session = GreenMailUtil . getSession ( ServerSetupTest . IMAP ) ; try { Store store = session . getStore ( "imap" ) ; store . connect ( user . getEmail ( ) , user . getPassword ( ) ) ; try { ( ( QuotaAwareStore ) store ) . setQuota ( quota ) ; } finally { store . close ( ) ; } } catch ( Exception ex ) { throw new IllegalStateException ( "Can not set quota " + quota + " for user " + user , ex ) ; } }
Sets a quota for a users .