net.sf.tomp.el.author
Class CourseTree

java.lang.Object
  extended by net.sf.tomp.el.author.CourseTree

public class CourseTree
extends java.lang.Object


Field Summary
static java.lang.String buildPropertiesFileName
           
 
Constructor Summary
CourseTree(java.io.File root)
          Creates a new instance of CourseTree ans sets its root file.
 
Method Summary
 void addCourse(Course c)
          Adds a Course to a CourseTree.
static boolean deleteDir(java.io.File dir)
          Deletes a non-empty directory.
 Course getCourse(java.lang.String id)
          Returns Course from courses.
 java.util.Collection<Course> getCourses()
          Returns a collection of Courses' values.
 Course getCurrentCourse()
          Returns current course from properties.
 Lecture getCurrentLecture()
          Returns current lecture from properties.
 java.lang.String getCurrentParameters()
          Returns current parameters from properties.
 java.lang.String getCurrentTerm()
          Returns current term from properties.
 java.io.File getDirectory()
          Returns the root file.
 Course getFirstCourse()
          Returns first course in courses sorted map.
 java.lang.String getPrincipalDoc()
          Returns principal document.
 Course newCourse(java.lang.String id)
          Created a new Course, makes its directories (also for its lectures), its main-info.xml file and puts the Course into the CourseTree.
 void readBuildProperties()
          Reads build properties from a file.
 void removeCourse(Course c)
           
 java.lang.String toString()
          Creates string of CourseTree's courses.
 void writeBuildProperties()
          Writes build properties to a file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

buildPropertiesFileName

public static final java.lang.String buildPropertiesFileName
See Also:
Constant Field Values
Constructor Detail

CourseTree

public CourseTree(java.io.File root)
Creates a new instance of CourseTree ans sets its root file. Creates a new instance of its TreeMap courses.

Parameters:
root - Root file
Method Detail

getCourses

public java.util.Collection<Course> getCourses()
Returns a collection of Courses' values.

Returns:
Collection of Courses' values.

addCourse

public void addCourse(Course c)
Adds a Course to a CourseTree.

Parameters:
c - Course to add.

newCourse

public Course newCourse(java.lang.String id)
                 throws java.io.IOException
Created a new Course, makes its directories (also for its lectures), its main-info.xml file and puts the Course into the CourseTree.

Parameters:
id - Course's ID.
Returns:
Created Course
Throws:
when
java.io.IOException

removeCourse

public void removeCourse(Course c)

deleteDir

public static boolean deleteDir(java.io.File dir)
Deletes a non-empty directory.

Parameters:
dir - directory to delete
Returns:
True, if directory is successfully deleted.

getCourse

public Course getCourse(java.lang.String id)
Returns Course from courses.

Parameters:
id - Course's ID.
Returns:
Course from courses.

getFirstCourse

public Course getFirstCourse()
Returns first course in courses sorted map.

Returns:
First course from courses

readBuildProperties

public void readBuildProperties()
Reads build properties from a file.


writeBuildProperties

public void writeBuildProperties()
Writes build properties to a file.


getCurrentTerm

public java.lang.String getCurrentTerm()
Returns current term from properties.

Returns:
String containing current term.

getCurrentCourse

public Course getCurrentCourse()
Returns current course from properties.

Returns:
Current course.

getCurrentLecture

public Lecture getCurrentLecture()
Returns current lecture from properties.

Returns:
Current lecture.

getCurrentParameters

public java.lang.String getCurrentParameters()
Returns current parameters from properties.

Returns:
Current parameteres.

getPrincipalDoc

public java.lang.String getPrincipalDoc()
Returns principal document. Not implemented yet!

Returns:
Principal document.

getDirectory

public java.io.File getDirectory()
Returns the root file.

Returns:
Root file.

toString

public java.lang.String toString()
Creates string of CourseTree's courses.

Overrides:
toString in class java.lang.Object
Returns:
String containing CourseTree's courses..