All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.mindsnacks.zinc.classes.jobs.ZincDownloadObjectJob Maven / Gradle / Ivy

There is a newer version: 1.6.2
Show newest version
package com.mindsnacks.zinc.classes.jobs;

import com.google.gson.Gson;

import java.io.InputStreamReader;
import java.net.URL;

/**
 * User: NachoSoto
 * Date: 9/4/13
 */
public class ZincDownloadObjectJob extends AbstractZincDownloadJob {
    private final Gson mGson;

    public ZincDownloadObjectJob(final ZincRequestExecutor requestFactory, final URL url, final Gson gson, final Class theClass) {
        super(requestFactory, url, theClass);
        mGson = gson;
    }

    @Override
    public V run() throws Exception {
        return mGson.fromJson(new InputStreamReader(mRequestExecutor.get(mUrl)), mClass);
    }

    @Override
    protected String getJobName() {
        return super.getJobName() + " <" + mClass.getSimpleName() + ">";
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy