@Test @Transactional(propagation = Propagation.REQUIRES_NEW) public void testRegisterUrl() throws Exception { String bedUrl = UrlTestingUtils.TEST_FILE_SERVER_URL + "/genes_sorted.bed"; String indexUrl = UrlTestingUtils.TEST_FILE_SERVER_URL + "/genes_sorted.bed.tbi"; Server server = UrlTestingUtils.getFileServer(context); try { server.start(); IndexedFileRegistrationRequest request = new IndexedFileRegistrationRequest(); request.setPath(bedUrl); request.setType(BiologicalDataItemResourceType.URL); request.setIndexType(BiologicalDataItemResourceType.URL); request.setIndexPath(indexUrl); request.setReferenceId(referenceId); BedFile bedFile = bedManager.registerBed(request); Assert.assertNotNull(bedFile); bedFile = bedFileManager.load(bedFile.getId()); Assert.assertNotNull(bedFile.getId()); Assert.assertNotNull(bedFile.getBioDataItemId()); Assert.assertNotNull(bedFile.getIndex()); Assert.assertFalse(bedFile.getPath().isEmpty()); Assert.assertFalse(bedFile.getIndex().getPath().isEmpty()); testLoadBedRecords(bedFile); } finally { server.stop(); } }
public BedFile registerBed(final IndexedFileRegistrationRequest request) { final String requestPath = request.getPath(); Assert.isTrue(StringUtils.isNotBlank(requestPath), getMessage( MessagesConstants.ERROR_NULL_PARAM, "path")); Assert.notNull(request.getReferenceId(), getMessage(MessagesConstants.ERROR_NULL_PARAM, "referenceId")); if (request.getType() == null) { request.setType(BiologicalDataItemResourceType.FILE); } BedFile bedFile; try { bedFile = createBedFile(request); } catch (IOException | HistogramReadingException e) { throw new RegistrationException(e.getMessage(), e); } return bedFile; }
BedManager { public BedFile registerBed(final IndexedFileRegistrationRequest request) { final String requestPath = request.getPath(); Assert.isTrue(StringUtils.isNotBlank(requestPath), getMessage( MessagesConstants.ERROR_NULL_PARAM, "path")); Assert.notNull(request.getReferenceId(), getMessage(MessagesConstants.ERROR_NULL_PARAM, "referenceId")); if (request.getType() == null) { request.setType(BiologicalDataItemResourceType.FILE); } BedFile bedFile; try { bedFile = createBedFile(request); } catch (IOException | HistogramReadingException e) { throw new RegistrationException(e.getMessage(), e); } return bedFile; } }
BedManager { public BedFile registerBed(final IndexedFileRegistrationRequest request) { final String requestPath = request.getPath(); Assert.isTrue(StringUtils.isNotBlank(requestPath), getMessage( MessagesConstants.ERROR_NULL_PARAM, "path")); Assert.notNull(request.getReferenceId(), getMessage(MessagesConstants.ERROR_NULL_PARAM, "referenceId")); if (request.getType() == null) { request.setType(BiologicalDataItemResourceType.FILE); } BedFile bedFile; try { bedFile = createBedFile(request); } catch (IOException | HistogramReadingException e) { throw new RegistrationException(e.getMessage(), e); } return bedFile; }  }
BedManager { public BedFile registerBed(final IndexedFileRegistrationRequest request) { final String requestPath = request.getPath(); Assert.isTrue(StringUtils.isNotBlank(requestPath), getMessage( MessagesConstants.ERROR_NULL_PARAM, "path")); Assert.notNull(request.getReferenceId(), getMessage(MessagesConstants.ERROR_NULL_PARAM, "referenceId")); if (request.getType() == null) { request.setType(BiologicalDataItemResourceType.FILE); } BedFile bedFile; try { bedFile = createBedFile(request); } catch (IOException | HistogramReadingException e) { throw new RegistrationException(e.getMessage(), e); } return bedFile; }  BedFile registerBed(final IndexedFileRegistrationRequest request); Track<BedRecord> loadFeatures(final Track<BedRecord> track); Track<BedRecord> loadFeatures(final Track<BedRecord> track, String fileUrl, String indexUrl); Track<Wig> loadHistogram(final Track<Wig> track); BedFile unregisterBedFile(long bedFileId); BedFile reindexBedFile(long bedFileId); }
BedManager { public BedFile registerBed(final IndexedFileRegistrationRequest request) { final String requestPath = request.getPath(); Assert.isTrue(StringUtils.isNotBlank(requestPath), getMessage( MessagesConstants.ERROR_NULL_PARAM, "path")); Assert.notNull(request.getReferenceId(), getMessage(MessagesConstants.ERROR_NULL_PARAM, "referenceId")); if (request.getType() == null) { request.setType(BiologicalDataItemResourceType.FILE); } BedFile bedFile; try { bedFile = createBedFile(request); } catch (IOException | HistogramReadingException e) { throw new RegistrationException(e.getMessage(), e); } return bedFile; }  BedFile registerBed(final IndexedFileRegistrationRequest request); Track<BedRecord> loadFeatures(final Track<BedRecord> track); Track<BedRecord> loadFeatures(final Track<BedRecord> track, String fileUrl, String indexUrl); Track<Wig> loadHistogram(final Track<Wig> track); BedFile unregisterBedFile(long bedFileId); BedFile reindexBedFile(long bedFileId);  }