borgbutler-server/src/main/java/de/micromata/borgbutler/server/rest/ArchivesRest.java
@@ -33,16 +33,16 @@ public class ArchivesRest { private static Logger log = LoggerFactory.getLogger(ArchivesRest.class); @GET @Produces(MediaType.APPLICATION_JSON) /** * * @param repo Name of repository ({@link Repository#getName()}. * @param repoName Name of repository ({@link Repository#getName()}. * @param archiveId Id or name of archive. * @param prettyPrinter If true then the json output will be in pretty format. * @return Repository (including list of archives) as json string. * @see JsonUtils#toJson(Object, boolean) */ @GET @Produces(MediaType.APPLICATION_JSON) public String getArchive(@QueryParam("repo") String repoName, @QueryParam("archiveId") String archiveId, @QueryParam("force") boolean force, @QueryParam("prettyPrinter") boolean prettyPrinter) { @@ -53,9 +53,6 @@ return JsonUtils.toJson(archive, prettyPrinter); } @GET @Path("filelist") @Produces(MediaType.APPLICATION_JSON) /** * * @param archiveId Id or name of archive. @@ -69,6 +66,9 @@ * @return Repository (including list of archives) as json string. * @see JsonUtils#toJson(Object, boolean) */ @GET @Path("filelist") @Produces(MediaType.APPLICATION_JSON) public String getArchiveFileList(@QueryParam("archiveId") String archiveId, @QueryParam("searchString") String searchString, @QueryParam("mode") String mode, @@ -105,13 +105,13 @@ return JsonUtils.toJson(items, prettyPrinter); } @GET @Path("/restore") @Produces(MediaType.APPLICATION_OCTET_STREAM) /** * @param archiveId * @param fileNumber The fileNumber of the file or directory in the archive served by BorgButler's */ @GET @Path("/restore") @Produces(MediaType.APPLICATION_OCTET_STREAM) public Response restore(@QueryParam("archiveId") String archiveId, @QueryParam("fileNumber") int fileNumber) { log.info("Requesting file #" + fileNumber + " of archive '" + archiveId + "'."); FileSystemFilter filter = new FileSystemFilter().setFileNumber(fileNumber); borgbutler-server/src/main/java/de/micromata/borgbutler/server/rest/ConfigurationRest.java
@@ -19,14 +19,14 @@ public class ConfigurationRest { private Logger log = LoggerFactory.getLogger(ConfigurationRest.class); @GET @Path("config") @Produces(MediaType.APPLICATION_JSON) /** * * @param prettyPrinter If true then the json output will be in pretty format. * @see JsonUtils#toJson(Object, boolean) */ @GET @Path("config") @Produces(MediaType.APPLICATION_JSON) public String getConfig(@QueryParam("prettyPrinter") boolean prettyPrinter) { String json = JsonUtils.toJson(ServerConfiguration.get(), prettyPrinter); return json; @@ -45,14 +45,14 @@ configurationHandler.save(); } @GET @Path("user") @Produces(MediaType.APPLICATION_JSON) /** * * @param prettyPrinter If true then the json output will be in pretty format. * @see JsonUtils#toJson(Object, boolean) */ @GET @Path("user") @Produces(MediaType.APPLICATION_JSON) public String getUser(@QueryParam("prettyPrinter") boolean prettyPrinter) { UserData user = RestUtils.getUser(); String json = JsonUtils.toJson(user, prettyPrinter); borgbutler-server/src/main/java/de/micromata/borgbutler/server/rest/I18nRest.java
@@ -20,9 +20,6 @@ public class I18nRest { private Logger log = LoggerFactory.getLogger(I18nRest.class); @GET @Path("list") @Produces(MediaType.APPLICATION_JSON) /** * * @param requestContext For detecting the user's client locale. @@ -31,6 +28,9 @@ * @param prettyPrinter If true then the json output will be in pretty format. * @see JsonUtils#toJson(Object, boolean) */ @GET @Path("list") @Produces(MediaType.APPLICATION_JSON) public String getList(@Context HttpServletRequest requestContext, @QueryParam("prettyPrinter") boolean prettyPrinter, @QueryParam("keysOnly") boolean keysOnly, @QueryParam("locale") String locale) { Locale localeObject; borgbutler-server/src/main/java/de/micromata/borgbutler/server/rest/JobsRest.java
@@ -28,8 +28,6 @@ private static List<JsonJobQueue> testList, oldJobsTestList; @GET @Produces(MediaType.APPLICATION_JSON) /** * @param repo If given, only the job queue of the given repo will be returned. * @param testMode If true, then a test job list is created. @@ -37,6 +35,8 @@ * @return Job queues as json string. * @see JsonUtils#toJson(Object, boolean) */ @GET @Produces(MediaType.APPLICATION_JSON) public String getJobs(@QueryParam("repo") String repo, @QueryParam("testMode") boolean testMode, @QueryParam("oldJobs") boolean oldJobs, @@ -86,11 +86,11 @@ return queue; } @Path("/cancel") @GET /** * @param uniqueJobNumberString The id of the job to cancel. */ @Path("/cancel") @GET public void cancelJob(@QueryParam("uniqueJobNumber") String uniqueJobNumberString) { Long uniqueJobNumber = null; try { borgbutler-server/src/main/java/de/micromata/borgbutler/server/rest/ReposRest.java
@@ -19,15 +19,15 @@ public class ReposRest { private static Logger log = LoggerFactory.getLogger(ReposRest.class); @GET @Path("list") @Produces(MediaType.APPLICATION_JSON) /** * * @param prettyPrinter If true then the json output will be in pretty format. * @return A list of repositories of type {@link BorgRepository}. * @see JsonUtils#toJson(Object, boolean) */ @GET @Path("list") @Produces(MediaType.APPLICATION_JSON) public String getList(@QueryParam("prettyPrinter") boolean prettyPrinter) { List<Repository> repositories = ButlerCache.getInstance().getAllRepositories(); if (CollectionUtils.isEmpty(repositories)) { @@ -36,25 +36,36 @@ return JsonUtils.toJson(repositories, prettyPrinter); } @GET @Path("repo") @Produces(MediaType.APPLICATION_JSON) /** * * @param id id or name of repo. * @param force If true, a reload of all repositories is forced. * @param prettyPrinter If true then the json output will be in pretty format. * @return Repository (without list of archives) as json string. * @see JsonUtils#toJson(Object, boolean) */ @GET @Path("repo") @Produces(MediaType.APPLICATION_JSON) public String getRepo(@QueryParam("id") String id, @QueryParam("prettyPrinter") boolean prettyPrinter) { Repository repository = ButlerCache.getInstance().getRepository(id); return JsonUtils.toJson(repository, prettyPrinter); } /** * * @param id id or name of repo. * @param prettyPrinter If true then the json output will be in pretty format. * @return BorgRepoConf as json string. * @see JsonUtils#toJson(Object, boolean) */ @GET @Path("repoArchiveList") @Path("repo-config") @Produces(MediaType.APPLICATION_JSON) public String getRepoConfig(@QueryParam("id") String id, @QueryParam("prettyPrinter") boolean prettyPrinter) { Repository repository = ButlerCache.getInstance().getRepository(id); return JsonUtils.toJson(repository, prettyPrinter); } /** * * @param id id or name of repo. @@ -62,6 +73,9 @@ * @return Repository (including list of archives) as json string. * @see JsonUtils#toJson(Object, boolean) */ @GET @Path("repoArchiveList") @Produces(MediaType.APPLICATION_JSON) public String getRepoArchiveList(@QueryParam("id") String id, @QueryParam("force") boolean force, @QueryParam("prettyPrinter") boolean prettyPrinter) { if (force) { borgbutler-server/src/main/java/de/micromata/borgbutler/server/rest/SystemInfoRest.java
@@ -16,13 +16,13 @@ public class SystemInfoRest { private static Logger log = LoggerFactory.getLogger(SystemInfoRest.class); @GET @Produces(MediaType.APPLICATION_JSON) @Path("info") /** * @return The total number of jobs queued or running (and other statistics): {@link de.micromata.borgbutler.BorgQueueStatistics}. * @see JsonUtils#toJson(Object, boolean) */ @GET @Produces(MediaType.APPLICATION_JSON) @Path("info") public String getStatistics() { BorgVersion borgVersion = ServerConfiguration.get().getBorgVersion(); SystemInfo systemInfonfo = new SystemInfo() borgbutler-server/src/main/java/de/micromata/borgbutler/server/rest/VersionRest.java
@@ -22,15 +22,15 @@ public class VersionRest { private Logger log = LoggerFactory.getLogger(VersionRest.class); @GET @Path("version") @Produces(MediaType.APPLICATION_JSON) /** * * @param requestContext For detecting the user's client locale. * @param prettyPrinter If true then the json output will be in pretty format. * @see JsonUtils#toJson(Object, boolean) */ @GET @Path("version") @Produces(MediaType.APPLICATION_JSON) public String getVersion(@Context HttpServletRequest requestContext, @QueryParam("prettyPrinter") boolean prettyPrinter) { UserData user = RestUtils.getUser(); String language = Languages.asString(user.getLocale());