Search in sources :

Example 1 with FileDownloadException

use of uk.ac.bris.cs.rfideasalreadytaken.lumberjack.exceptions.FileDownloadException in project lumberjack by fn-ctional.

the class WebController method getDevicesCSV.

@GetMapping(value = "/CSV/devices", produces = "text/csv")
public void getDevicesCSV(HttpServletResponse response) throws FileDownloadException {
    try {
        String csv = webBackend.getDevicesCSV();
        response.getWriter().append(csv);
    } catch (IOException | SQLException e) {
        e.printStackTrace();
        throw new FileDownloadException();
    }
}
Also used : SQLException(java.sql.SQLException) FileDownloadException(uk.ac.bris.cs.rfideasalreadytaken.lumberjack.exceptions.FileDownloadException)

Example 2 with FileDownloadException

use of uk.ac.bris.cs.rfideasalreadytaken.lumberjack.exceptions.FileDownloadException in project lumberjack by fn-ctional.

the class WebController method getUsersCSV.

@GetMapping(value = "/CSV/users", produces = "text/csv")
public void getUsersCSV(HttpServletResponse response) throws FileDownloadException {
    try {
        String csv = webBackend.getUsersCSV();
        response.getWriter().append(csv);
    } catch (IOException | SQLException e) {
        e.printStackTrace();
        throw new FileDownloadException();
    }
}
Also used : SQLException(java.sql.SQLException) FileDownloadException(uk.ac.bris.cs.rfideasalreadytaken.lumberjack.exceptions.FileDownloadException)

Aggregations

SQLException (java.sql.SQLException)2 FileDownloadException (uk.ac.bris.cs.rfideasalreadytaken.lumberjack.exceptions.FileDownloadException)2