Home Reference Source

src/file-sharing/FileManager.js

import {FileUploadManager} from './FileUploadManager';

export class FileManager {
	/** @protected */
	static newInstance(fileSharingService) {
		return new FileManager(fileSharingService);
	}

	/** @private */
	constructor(fileSharingService) {
		/** @private */
		this.fileSharingService = fileSharingService;
	}

	/**
	 * @return {Promise<FileUploadManager>}
	 */
	getFileUploadManager() {
		if (!this._fileUploadManager) {
			this._fileUploadManager = FileUploadManager.newInstance(this.fileSharingService);
		}
		return this._fileUploadManager;
	}

	// TODO Allow obtaining files of the user and removing them.
}