Creates and returns a REST command. @param session REST session @return command @throws QueryException query exception @throws IOException I/O exception
(final RESTSession session)
| 24 | * @throws IOException I/O exception |
| 25 | */ |
| 26 | static RESTExec get(final RESTSession session) throws QueryException, IOException { |
| 27 | RESTCmd.assignOptions(session); |
| 28 | |
| 29 | final HTTPConnection conn = session.conn; |
| 30 | final String db = conn.db(); |
| 31 | if(db.isEmpty()) throw HTTPStatus.NO_DATABASE_SPECIFIED.get(); |
| 32 | |
| 33 | // open database to ensure it exists |
| 34 | final String path = conn.dbpath(); |
| 35 | session.add(path.isEmpty() ? new DropDB(db) : new Delete(path)); |
| 36 | return new RESTExec(session, false); |
| 37 | } |
| 38 | } |