<commit_before>import { Component, OnInit } from '@angular/core';
import { Http, RequestMethod, ResponseContentType, Headers } from '@angular/http';
import { Observable } from 'rxjs/Observable';

import { FileuploaderSettings, FileuploaderLangs } from '../../components/fileuploader/fileuploader.model'

@Component({
    moduleId: module.id,
    selector: 'fileuploader-demo',
    templateUrl: 'fileuploader.demo.html'
})
export class FileuploaderDemoComponent implements OnInit {
    public files: Array<any> = [];
    public existenFileUrls: Array<string> = [];
    public filePath: string = 'dist/resources/img/sample/';

    public settings: FileuploaderSettings = {
        
    };

    public langs: FileuploaderLangs = {
        
    };

    constructor(private http: Http) {
        this.existenFileUrls.push('sample_1.jpg');
        this.existenFileUrls.push('sample_2.jpg');
        this.existenFileUrls.push('sample_3.jpg');
    }

    ngOnInit() {
        for (var key in this.existenFileUrls) {
            let filename = this.existenFileUrls[key];
            let ext = filename.split('.').pop();

            this.getFileBlob(filename).subscribe(
                (response) => {
                    let blob = new Blob([response.blob()], {type: ext});
                    let file = new File([blob], filename, {type: ext});
                    this.files.push(file);
            });
        }
    }

    getFileBlob(filename: string): Observable<any> {
        return this.http.get(this.filePath + filename, {
            method: RequestMethod.Post,
            responseType: ResponseContentType.Blob,
            headers: new Headers({'Content-Type': 'application/x-www-form-urlencoded'})
        });
    }

    handleUpload(data: any) {
        if (data && data.files) {
            this.files = data.files;
        }
    }
}<commit_msg>change request method get in fileuploader demo<commit_after>import { Component, OnInit } from '@angular/core';
import { Http, RequestMethod, ResponseContentType, Headers } from '@angular/http';
import { Observable } from 'rxjs/Observable';

import { FileuploaderSettings, FileuploaderLangs } from '../../components/fileuploader/fileuploader.model'

@Component({
    moduleId: module.id,
    selector: 'fileuploader-demo',
    templateUrl: 'fileuploader.demo.html'
})
export class FileuploaderDemoComponent implements OnInit {
    public files: Array<any> = [];
    public existenFileUrls: Array<string> = [];
    public filePath: string = 'dist/resources/img/sample/';

    public settings: FileuploaderSettings = {
        
    };

    public langs: FileuploaderLangs = {
        
    };

    constructor(private http: Http) {
        this.existenFileUrls.push('sample_1.jpg');
        this.existenFileUrls.push('sample_2.jpg');
        this.existenFileUrls.push('sample_3.jpg');
    }

    ngOnInit() {
        for (var key in this.existenFileUrls) {
            let filename = this.existenFileUrls[key];
            let ext = filename.split('.').pop();

            this.getFileBlob(filename).subscribe(
                (response) => {
                    let blob = new Blob([response.blob()], {type: ext});
                    let file = new File([blob], filename, {type: ext});
                    this.files.push(file);
            });
        }
    }

    getFileBlob(filename: string): Observable<any> {
        return this.http.get(this.filePath + filename, {
            method: RequestMethod.Get,
            responseType: ResponseContentType.Blob,
            headers: new Headers({'Content-Type': 'application/x-www-form-urlencoded'})
        });
    }

    handleUpload(data: any) {
        if (data && data.files) {
            this.files = data.files;
        }
    }
}
{'fraction_non_alphanumeric': 0.13101604278074866, 'fraction_numerical': 0.0016042780748663102, 'mean_word_length': 2.4164383561643836, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5889249', 'n_tokens_mistral': 1093, 'n_tokens_neox': 1069, 'n_words': 214}