com.mindsnacks.zinc.classes.jobs.ZincDownloadObjectJob Maven / Gradle / Ivy
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