@Test public void testGetRepositoryType() throws Exception { File mercurialRoot = new File(repository.getSourceRoot() + File.separator + "mercurial"); MercurialRepositoryTest.runHgCommand(mercurialRoot, "clone", mercurialRoot.getAbsolutePath(), mercurialRoot.getAbsolutePath() + File.separator + "closed"); env.setHistoryEnabled(true); Indexer.getInstance().prepareIndexer( env, true, true, false, null, null); assertEquals("Mercurial", getRepoType(Paths.get("/mercurial").toString())); assertEquals("Mercurial", getRepoType(Paths.get("/mercurial/closed").toString())); assertEquals("git", getRepoType(Paths.get("/git").toString())); }
@GET @Path("/property/{field}") @Produces(MediaType.APPLICATION_JSON) public Object get(@QueryParam("repository") final String repositoryPath, @PathParam("field") final String field) throws IOException { Object ri = getRepositoryInfoData(repositoryPath); if (ri == null) { throw new WebApplicationException("cannot find repository with path: " + repositoryPath, Response.Status.NOT_FOUND); } return ClassUtil.getFieldValue(ri, field); }
RepositoriesController { @GET @Path("/property/{field}") @Produces(MediaType.APPLICATION_JSON) public Object get(@QueryParam("repository") final String repositoryPath, @PathParam("field") final String field) throws IOException { Object ri = getRepositoryInfoData(repositoryPath); if (ri == null) { throw new WebApplicationException("cannot find repository with path: " + repositoryPath, Response.Status.NOT_FOUND); } return ClassUtil.getFieldValue(ri, field); } }
RepositoriesController { @GET @Path("/property/{field}") @Produces(MediaType.APPLICATION_JSON) public Object get(@QueryParam("repository") final String repositoryPath, @PathParam("field") final String field) throws IOException { Object ri = getRepositoryInfoData(repositoryPath); if (ri == null) { throw new WebApplicationException("cannot find repository with path: " + repositoryPath, Response.Status.NOT_FOUND); } return ClassUtil.getFieldValue(ri, field); }  }
RepositoriesController { @GET @Path("/property/{field}") @Produces(MediaType.APPLICATION_JSON) public Object get(@QueryParam("repository") final String repositoryPath, @PathParam("field") final String field) throws IOException { Object ri = getRepositoryInfoData(repositoryPath); if (ri == null) { throw new WebApplicationException("cannot find repository with path: " + repositoryPath, Response.Status.NOT_FOUND); } return ClassUtil.getFieldValue(ri, field); }  @GET @Path("/property/{field}") @Produces(MediaType.APPLICATION_JSON) Object get(@QueryParam("repository") final String repositoryPath, @PathParam("field") final String field); }
RepositoriesController { @GET @Path("/property/{field}") @Produces(MediaType.APPLICATION_JSON) public Object get(@QueryParam("repository") final String repositoryPath, @PathParam("field") final String field) throws IOException { Object ri = getRepositoryInfoData(repositoryPath); if (ri == null) { throw new WebApplicationException("cannot find repository with path: " + repositoryPath, Response.Status.NOT_FOUND); } return ClassUtil.getFieldValue(ri, field); }  @GET @Path("/property/{field}") @Produces(MediaType.APPLICATION_JSON) Object get(@QueryParam("repository") final String repositoryPath, @PathParam("field") final String field);  }