play.Environment.isDev()

Here are the examples of the java api play.Environment.isDev() taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

3 Examples 7

18 Source : DatabaseSeedController.java
with Apache License 2.0
from seattle-uat

/**
 * Remove all content from the program and question tables.
 */
public Result clear() {
    if (environment.isDev()) {
        truncateTables();
        return redirect(routes.DatabaseSeedController.index().url()).flashing("success", "The database has been cleared");
    } else {
        return notFound();
    }
}

18 Source : DatabaseSeedController.java
with Apache License 2.0
from seattle-uat

public Result seed() {
    // TODO: consider checking whether the test program already exists.
    if (environment.isDev()) {
        insertProgramWithBlocks("Mock program");
        return redirect(routes.DatabaseSeedController.index().url()).flashing("success", "The database has been seeded");
    } else {
        return notFound();
    }
}

14 Source : DatabaseSeedController.java
with Apache License 2.0
from seattle-uat

/**
 * Display state of the database in roughly formatted string. Displays a button to generate mock
 * database content and another to clear the database.
 */
public Result index(Request request) {
    if (environment.isDev()) {
        ImmutableList<ProgramDefinition> programDefinitions = programService.listProgramDefinitions();
        ImmutableList<QuestionDefinition> questionDefinitions = questionService.getReadOnlyQuestionService().toCompletableFuture().join().getAllQuestions();
        return ok(view.render(request, programDefinitions, questionDefinitions, request.flash().get("success")));
    } else {
        return notFound();
    }
}