Search in sources :

Example 1 with HttpAction

use of org.apache.jena.fuseki.servlets.HttpAction in project jena by apache.

the class ActionBackup method doPost.

@Override
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException {
    String dataset = FusekiLib.safeParameter(request, "dataset");
    if (dataset == null) {
        response.sendError(HttpSC.BAD_REQUEST_400, "Required parameter missing: ?dataset=");
        return;
    }
    if (!dataset.startsWith("/"))
        dataset = "/" + dataset;
    // HttpSession session = request.getSession(true) ;
    // session.setAttribute("dataset", dataset) ;
    // session.setMaxInactiveInterval(15*60) ; // 10 mins
    boolean known = DatasetRegistry.get().isRegistered(dataset);
    if (!known) {
        response.sendError(HttpSC.BAD_REQUEST_400, "No such dataset: " + dataset);
        return;
    }
    long id = allocRequestId(request, response);
    HttpAction action = new HttpAction(id, request, response, false);
    DatasetRef ref = DatasetRegistry.get().get(dataset);
    action.setDataset(ref);
    scheduleBackup(action);
}
Also used : DatasetRef(org.apache.jena.fuseki.server.DatasetRef) HttpAction(org.apache.jena.fuseki.servlets.HttpAction)

Aggregations

DatasetRef (org.apache.jena.fuseki.server.DatasetRef)1 HttpAction (org.apache.jena.fuseki.servlets.HttpAction)1