@Test public void testGetAvailableDownloads() throws PhrescoException { PhrescoServerFactory.initialize(); RepositoryManager repoMgr = PhrescoServerFactory.getRepositoryManager(); String downloadInfoJSON = repoMgr.getArtifactAsString(SOFTWARE_REPO_PATH); Type type = new TypeToken<List<DownloadInfo>>() {}.getType(); Gson gson = new Gson(); List<DownloadInfo> downloadInfoList = gson.fromJson(downloadInfoJSON, type); assertNotNull(downloadInfoList); }
@POST @Consumes(MediaType.APPLICATION_JSON) @Produces({MediaType.APPLICATION_JSON}) public List<DownloadInfo> getAvailableDownloads(DownloadPropertyInfo downloadPropertyInfo) throws PhrescoException, JSONException, FileNotFoundException { S_LOGGER.info("Retrieving downloads "); List<DownloadInfo> downloadList = new ArrayList<DownloadInfo>(); PhrescoServerFactory.initialize(); RepositoryManager repoMgr = PhrescoServerFactory.getRepositoryManager(); String downloadInfoJSON = repoMgr.getArtifactAsString(SOFTWARE_REPO_PATH); Type type = new TypeToken<List<DownloadInfo>>() {}.getType(); Gson gson = new Gson(); List<DownloadInfo> downloadInfoList = gson.fromJson(downloadInfoJSON, type); for (DownloadInfo downloadInfo : downloadInfoList) { List<String> platforms = downloadInfo.getPlatform(); List<String> appliesTo = downloadInfo.getAppliesTo(); if (platforms.contains(downloadPropertyInfo.getOsName()) && appliesTo.contains(downloadPropertyInfo.getTechId())) { downloadList.add(downloadInfo); } } return downloadList; }
DownloadsService implements ServerConstants { @POST @Consumes(MediaType.APPLICATION_JSON) @Produces({MediaType.APPLICATION_JSON}) public List<DownloadInfo> getAvailableDownloads(DownloadPropertyInfo downloadPropertyInfo) throws PhrescoException, JSONException, FileNotFoundException { S_LOGGER.info("Retrieving downloads "); List<DownloadInfo> downloadList = new ArrayList<DownloadInfo>(); PhrescoServerFactory.initialize(); RepositoryManager repoMgr = PhrescoServerFactory.getRepositoryManager(); String downloadInfoJSON = repoMgr.getArtifactAsString(SOFTWARE_REPO_PATH); Type type = new TypeToken<List<DownloadInfo>>() {}.getType(); Gson gson = new Gson(); List<DownloadInfo> downloadInfoList = gson.fromJson(downloadInfoJSON, type); for (DownloadInfo downloadInfo : downloadInfoList) { List<String> platforms = downloadInfo.getPlatform(); List<String> appliesTo = downloadInfo.getAppliesTo(); if (platforms.contains(downloadPropertyInfo.getOsName()) && appliesTo.contains(downloadPropertyInfo.getTechId())) { downloadList.add(downloadInfo); } } return downloadList; } }
DownloadsService implements ServerConstants { @POST @Consumes(MediaType.APPLICATION_JSON) @Produces({MediaType.APPLICATION_JSON}) public List<DownloadInfo> getAvailableDownloads(DownloadPropertyInfo downloadPropertyInfo) throws PhrescoException, JSONException, FileNotFoundException { S_LOGGER.info("Retrieving downloads "); List<DownloadInfo> downloadList = new ArrayList<DownloadInfo>(); PhrescoServerFactory.initialize(); RepositoryManager repoMgr = PhrescoServerFactory.getRepositoryManager(); String downloadInfoJSON = repoMgr.getArtifactAsString(SOFTWARE_REPO_PATH); Type type = new TypeToken<List<DownloadInfo>>() {}.getType(); Gson gson = new Gson(); List<DownloadInfo> downloadInfoList = gson.fromJson(downloadInfoJSON, type); for (DownloadInfo downloadInfo : downloadInfoList) { List<String> platforms = downloadInfo.getPlatform(); List<String> appliesTo = downloadInfo.getAppliesTo(); if (platforms.contains(downloadPropertyInfo.getOsName()) && appliesTo.contains(downloadPropertyInfo.getTechId())) { downloadList.add(downloadInfo); } } return downloadList; }  }
DownloadsService implements ServerConstants { @POST @Consumes(MediaType.APPLICATION_JSON) @Produces({MediaType.APPLICATION_JSON}) public List<DownloadInfo> getAvailableDownloads(DownloadPropertyInfo downloadPropertyInfo) throws PhrescoException, JSONException, FileNotFoundException { S_LOGGER.info("Retrieving downloads "); List<DownloadInfo> downloadList = new ArrayList<DownloadInfo>(); PhrescoServerFactory.initialize(); RepositoryManager repoMgr = PhrescoServerFactory.getRepositoryManager(); String downloadInfoJSON = repoMgr.getArtifactAsString(SOFTWARE_REPO_PATH); Type type = new TypeToken<List<DownloadInfo>>() {}.getType(); Gson gson = new Gson(); List<DownloadInfo> downloadInfoList = gson.fromJson(downloadInfoJSON, type); for (DownloadInfo downloadInfo : downloadInfoList) { List<String> platforms = downloadInfo.getPlatform(); List<String> appliesTo = downloadInfo.getAppliesTo(); if (platforms.contains(downloadPropertyInfo.getOsName()) && appliesTo.contains(downloadPropertyInfo.getTechId())) { downloadList.add(downloadInfo); } } return downloadList; }  @POST @Consumes(MediaType.APPLICATION_JSON) @Produces({MediaType.APPLICATION_JSON}) List<DownloadInfo> getAvailableDownloads(DownloadPropertyInfo downloadPropertyInfo); }
DownloadsService implements ServerConstants { @POST @Consumes(MediaType.APPLICATION_JSON) @Produces({MediaType.APPLICATION_JSON}) public List<DownloadInfo> getAvailableDownloads(DownloadPropertyInfo downloadPropertyInfo) throws PhrescoException, JSONException, FileNotFoundException { S_LOGGER.info("Retrieving downloads "); List<DownloadInfo> downloadList = new ArrayList<DownloadInfo>(); PhrescoServerFactory.initialize(); RepositoryManager repoMgr = PhrescoServerFactory.getRepositoryManager(); String downloadInfoJSON = repoMgr.getArtifactAsString(SOFTWARE_REPO_PATH); Type type = new TypeToken<List<DownloadInfo>>() {}.getType(); Gson gson = new Gson(); List<DownloadInfo> downloadInfoList = gson.fromJson(downloadInfoJSON, type); for (DownloadInfo downloadInfo : downloadInfoList) { List<String> platforms = downloadInfo.getPlatform(); List<String> appliesTo = downloadInfo.getAppliesTo(); if (platforms.contains(downloadPropertyInfo.getOsName()) && appliesTo.contains(downloadPropertyInfo.getTechId())) { downloadList.add(downloadInfo); } } return downloadList; }  @POST @Consumes(MediaType.APPLICATION_JSON) @Produces({MediaType.APPLICATION_JSON}) List<DownloadInfo> getAvailableDownloads(DownloadPropertyInfo downloadPropertyInfo);  }