[ADF-3283] added minimatch options into the configuration to allow cu… (#3542)

* [ADF-3283] added minimatch options into the configuration to allow customisation

* [ADF-3283] added documentation
This commit is contained in:
Vito
2018-07-02 19:21:35 +01:00
committed by Eugenio Romano
parent de126670ee
commit cd4431e547
5 changed files with 76 additions and 4 deletions

View File

@@ -38,6 +38,7 @@ export class UploadService {
private totalAborted: number = 0;
private totalError: number = 0;
private excludedFileList: String[] = [];
private matchingOptions: any = null;
activeTask: Promise<any> = null;
queue: FileModel[] = [];
@@ -56,6 +57,7 @@ export class UploadService {
constructor(protected apiService: AlfrescoApiService,
appConfigService: AppConfigService) {
this.excludedFileList = <String[]> appConfigService.get('files.excluded');
this.matchingOptions = appConfigService.get('files.match-options');
}
/**
@@ -90,7 +92,7 @@ export class UploadService {
let isAllowed = true;
if (this.excludedFileList) {
isAllowed = this.excludedFileList.filter(expr => minimatch(file.name, expr)).length === 0;
isAllowed = this.excludedFileList.filter(expr => minimatch(file.name, expr, this.matchingOptions)).length === 0;
}
return isAllowed;
}