diff --git a/bigbluebutton-web/src/java/org/bigbluebutton/api/domain/Recordings.java b/bigbluebutton-web/src/java/org/bigbluebutton/api/domain/Recordings.java new file mode 100755 index 0000000000000000000000000000000000000000..cad5625b39edbadff9f94f2ef05ba20d2249911a --- /dev/null +++ b/bigbluebutton-web/src/java/org/bigbluebutton/api/domain/Recordings.java @@ -0,0 +1,25 @@ +package org.bigbluebutton.api.domain; + +import java.io.File; +import java.io.FileFilter; + +public class Recordings { + + public String[] getRecordings(String recordingDir) { + File dir = new File(recordingDir); + + FileFilter fileFilter = new FileFilter() { + public boolean accept(File file) { + return file.isDirectory(); + } + }; + + File[] dirs = dir.listFiles(fileFilter); + String[] meetings = new String[dirs.length]; + + for (int i = 0; i < dirs.length; i++) { + meetings[i] = dirs[i].getName(); + } + return meetings; + } +} diff --git a/bigbluebutton-web/test/integration/org/bigbluebutton/web/services/DynamicConferenceServiceTests.groovy b/bigbluebutton-web/test/integration/org/bigbluebutton/web/services/DynamicConferenceServiceTests.groovy old mode 100644 new mode 100755 index 3d8f6782a8ff5cf3c7f19c3b26c4aa3a134dcba4..1a1a0373760c4f13ae121c02785a2ba55f3689af --- a/bigbluebutton-web/test/integration/org/bigbluebutton/web/services/DynamicConferenceServiceTests.groovy +++ b/bigbluebutton-web/test/integration/org/bigbluebutton/web/services/DynamicConferenceServiceTests.groovy @@ -21,7 +21,6 @@ package org.bigbluebutton.web.services import grails.test.* -import org.bigbluebutton.presentation.service.DynamicConference import org.bigbluebutton.api.domain.DynamicConference class DynamicConferenceServiceTests extends GrailsUnitTestCase { diff --git a/bigbluebutton-web/test/unit/org/bigbluebutton/api/domain/RecordingsTests.groovy b/bigbluebutton-web/test/unit/org/bigbluebutton/api/domain/RecordingsTests.groovy new file mode 100755 index 0000000000000000000000000000000000000000..411a4553469c86820ab5587a1db3de797024d3ba --- /dev/null +++ b/bigbluebutton-web/test/unit/org/bigbluebutton/api/domain/RecordingsTests.groovy @@ -0,0 +1,41 @@ +/* BigBlueButton - http://www.bigbluebutton.org + * + * + * Copyright (c) 2008-2009 by respective authors (see below). All rights reserved. + * + * BigBlueButton is free software; you can redistribute it and/or modify it under the + * terms of the GNU Lesser General Public License as published by the Free Software + * Foundation; either version 3 of the License, or (at your option) any later + * version. + * + * BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY + * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A + * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License along + * with BigBlueButton; if not, If not, see <http://www.gnu.org/licenses/>. + * + * Author: Richard Alam <ritzalam@gmail.com> + * DJP <DJP@architectes.org> + * + * @version $Id: $ + */ +package org.bigbluebutton.api.domain; +import java.io.File; + +class RecordingsTests extends GroovyTestCase { + + def recordings + + void setUp() { + println "Test setup" + recordings = new Recordings() + } + + void testGetRecordings() { + String[] meetings = recordings.getRecordings("/var/bigbluebutton/recordings") + for (int i = 0; i < meetings.length; i++) { + println meetings[i]; + } + } +}