public static void main(String[] args) {
        try {
        	MoodleCallRestWebService.init("http://localhost:7070/moodle/webservice/rest/server.php", "d65f7f717b69f706873dcae6eef08ac7");
            MoodleCourse[] allCourses = MoodleRestCourse.getAllCourses();
            for (int i=0; i<allCourses.length; i++, System.out.println("************************************"))
                printCourseDetails(allCourses[i]);
             
            long [] courseids = new long[allCourses.length];
            for (int i = 0; i < allCourses.length; i++) {
				courseids[i] = allCourses[i].getId();
			}
            
            System.out.println(courseids);
            
           MoodleRestCourse.deleteCourses(courseids);
        } catch (MoodleRestException ex) {
            Logger.getLogger(TestDeleteCourses.class.getName()).log(Level.SEVERE, null, ex);
        } catch (UnsupportedEncodingException ex) {
            Logger.getLogger(TestDeleteCourses.class.getName()).log(Level.SEVERE, null, ex);
        }

    }