@Test @Transactional(propagation = Propagation.REQUIRES_NEW) public void testUnregisterBedFile() throws Exception { BedFile bedFile = testRegisterBed(GENES_SORTED_BED_PATH); bedManager.unregisterBedFile(bedFile.getId()); Assert.assertNull(bedFileManager.load(bedFile.getId())); List<BiologicalDataItem> dataItems = biologicalDataItemDao.loadBiologicalDataItemsByIds( Arrays.asList(bedFile.getBioDataItemId(), bedFile.getIndex().getId())); Assert.assertTrue(dataItems.isEmpty()); File dir = new File(baseDirPath + "/42/bed/" + bedFile.getId()); Assert.assertFalse(dir.exists()); }
public BedFile unregisterBedFile(long bedFileId) throws IOException { Assert.isTrue(bedFileId > 0, MessagesConstants.ERROR_INVALID_PARAM); final BedFile fileToDelete = bedFileManager.load(bedFileId); Assert.notNull(fileToDelete, MessagesConstants.ERROR_NO_SUCH_FILE); bedFileManager.delete(fileToDelete); fileManager.deleteFeatureFileDirectory(fileToDelete); return fileToDelete; }
BedManager { public BedFile unregisterBedFile(long bedFileId) throws IOException { Assert.isTrue(bedFileId > 0, MessagesConstants.ERROR_INVALID_PARAM); final BedFile fileToDelete = bedFileManager.load(bedFileId); Assert.notNull(fileToDelete, MessagesConstants.ERROR_NO_SUCH_FILE); bedFileManager.delete(fileToDelete); fileManager.deleteFeatureFileDirectory(fileToDelete); return fileToDelete; } }
BedManager { public BedFile unregisterBedFile(long bedFileId) throws IOException { Assert.isTrue(bedFileId > 0, MessagesConstants.ERROR_INVALID_PARAM); final BedFile fileToDelete = bedFileManager.load(bedFileId); Assert.notNull(fileToDelete, MessagesConstants.ERROR_NO_SUCH_FILE); bedFileManager.delete(fileToDelete); fileManager.deleteFeatureFileDirectory(fileToDelete); return fileToDelete; }  }
BedManager { public BedFile unregisterBedFile(long bedFileId) throws IOException { Assert.isTrue(bedFileId > 0, MessagesConstants.ERROR_INVALID_PARAM); final BedFile fileToDelete = bedFileManager.load(bedFileId); Assert.notNull(fileToDelete, MessagesConstants.ERROR_NO_SUCH_FILE); bedFileManager.delete(fileToDelete); fileManager.deleteFeatureFileDirectory(fileToDelete); return fileToDelete; }  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 unregisterBedFile(long bedFileId) throws IOException { Assert.isTrue(bedFileId > 0, MessagesConstants.ERROR_INVALID_PARAM); final BedFile fileToDelete = bedFileManager.load(bedFileId); Assert.notNull(fileToDelete, MessagesConstants.ERROR_NO_SUCH_FILE); bedFileManager.delete(fileToDelete); fileManager.deleteFeatureFileDirectory(fileToDelete); return fileToDelete; }  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);  }