package es.upvmaster.fullmediaplayer;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.InputStreamReader;

import static es.upvmaster.fullmediaplayer.Libreria.*;

/**
 * Created by crpor on 09/08/2016.
 */
public class JSONParser {
    String response = "";

    public JSONParser() {
    }

    public String makeServiceCall(File fichero) {
        try
        {
            BufferedReader fin =
                    new BufferedReader(
                            new InputStreamReader(
                                    new FileInputStream(fichero)));
            String linea;
            StringBuilder contenido = new StringBuilder();
            while ((linea = fin.readLine())!=null) {
                contenido.append(linea);
            }
            response = contenido.toString();
            fin.close();
        }
        catch (Exception e)
        {
            imprimirLog(TipoLog.ERROR,"Ficheros","Error al leer fichero desde memoria");
        }

        return response;
    }
}

