Search in sources :

Example 1 with RemoteEntriesAsCSV

use of org.jbei.ice.lib.net.RemoteEntriesAsCSV in project ice by JBEI.

the class WebResource method getWebEntries.

@GET
@Path("/entries")
public Response getWebEntries(@QueryParam("download") boolean download, @QueryParam("limit") int limit, @QueryParam("offset") int offset) {
    String userId = requireUserId();
    log(userId, "downloading web entries");
    RemoteEntriesAsCSV remoteEntriesAsCSV = new RemoteEntriesAsCSV(true);
    remoteEntriesAsCSV.getEntries(offset, limit);
    final File file = remoteEntriesAsCSV.getFilePath().toFile();
    if (file.exists()) {
        return Response.ok(new Setting("fileName", file.getName())).build();
    }
    return super.respond(false);
}
Also used : RemoteEntriesAsCSV(org.jbei.ice.lib.net.RemoteEntriesAsCSV) Setting(org.jbei.ice.lib.dto.Setting) File(java.io.File)

Aggregations

File (java.io.File)1 Setting (org.jbei.ice.lib.dto.Setting)1 RemoteEntriesAsCSV (org.jbei.ice.lib.net.RemoteEntriesAsCSV)1