message: Adds MediaDataService with functions
diff: import {Injectable} from '@angular/core';
  import {BackendService} from './backend.service';
  import {Dependency} from '../../about/licenses/dependency.model';
  -import {ITaskUnit} from '../../../../../../shared/models/units/ITaskUnit';
  import {ILecture} from '../../../../../../shared/models/ILecture';
  import {IUnit} from '../../../../../../shared/models/units/IUnit';
  import {IUser} from '../../../../../../shared/models/IUser';
  import {ICourse} from '../../../../../../shared/models/ICourse';
  +import {IDirectory} from '../../../../../../shared/models/mediaManager/IDirectory';
  +import {IFile} from '../../../../../../shared/models/mediaManager/IFile';
  export abstract class DataService {
  @@ -227,6 +228,86 @@ export class DuplicationService extends DataService {
  }
  }
  +@Injectable()
  +export class MediaService extends DataService {
  + constructor(public backendService: BackendService) {
  + super('media/', backendService);
  + }
  +
  + createRootDir(rootDirName: string): Promise<IDirectory> {
  + // TODO: If this works, apply to all
  + return this.backendService.put(this.apiPath + 'directory', JSON.stringify({name: rootDirName}))
  + .toPromise();
  + }
  +
  + createDir(newDirName: string, parentDir: IDirectory): Promise<IDirectory> {
  + return new Promise<IDirectory>((resolve, reject) => {
  + this.backendService.put(this.apiPath + 'directory/' + parentDir._id, JSON.stringify({name: newDirName}))
  + .subscribe((responseItem: IDirectory) => {
  + resolve(responseItem);
  + },
  + error => reject(error)
  + );
  + });
  + }
  +
  + addFile(directory: IDirectory): Promise<IFile> {
  + return new Promise<IFile>((resolve, reject) => {
  + this.backendService.put(this.apiPath + 'file/' + directory._id, JSON.stringify({}))
  + .subscribe((responseItem: IFile) => {
  + resolve(responseItem);
  + },
  + error => reject(error)
  + );
  + });
  + }
  +
  + getDirectory(dirId: string, lazy: boolean = false): Promise<IDirectory> {
  + const path = this.apiPath + 'directory/' + dirId + (lazy ? '/lazy' : '');
  + return new Promise<IDirectory>((resolve, reject) => {
  + this.backendService.get(path)
  + .subscribe((responseItem: IDirectory) => {
  + resolve(responseItem);
  + },
  + error => reject(error)
  + );
  + });
  + }
  +
  + getFile(fileId: string): Promise<IFile> {
  + return new Promise<IFile>((resolve, reject) => {
  + this.backendService.get(this.apiPath + 'file/' + fileId)
  + .subscribe((responseItem: IFile) => {
  + resolve(responseItem);
  + },
  + error => reject(error));
  + });
  + }
  +
  + deleteDirectory(dir: IDirectory): Promise<any> {
  + return new Promise<any>((resolve, reject) => {
  + this.backendService.delete(this.apiPath + 'directory/' + dir._id)
  + .subscribe(
  + (responseItem: any) => {
  + resolve(responseItem);
  + },
  + error => reject(error)
  + );
  + });
  + }
  +
  + deleteFile(file: IFile): Promise<any> {
  + return new Promise<any>((resolve, reject) => {
  + this.backendService.delete(this.apiPath + 'file/' + file._id)
  + .subscribe(
  + (responseItem: any) => {
  + resolve(responseItem);
  + },
  + error => reject(error)
  + );
  + });
  + }
  +}
  @Injectable()
  export class CourseService extends DataService {
  