@Test @Transactional(propagation = Propagation.REQUIRES_NEW) public void testRegisterSeg() throws IOException, InterruptedException, NoSuchAlgorithmException { SegFile segFile = testRegisterSeg("classpath:templates/test_seg.seg"); segManager.unregisterSegFile(segFile.getId()); SegFile loadedSeg = segFileManager.load(segFile.getId()); Assert.assertNull(loadedSeg); List<BiologicalDataItem> dataItems = biologicalDataItemDao.loadBiologicalDataItemsByIds( Arrays.asList(segFile.getBioDataItemId(), segFile.getIndex().getId())); Assert.assertTrue(dataItems.isEmpty()); File dir = new File(baseDirPath + "/42/seg/" + segFile.getId()); Assert.assertFalse(dir.exists()); }
public SegFile unregisterSegFile(final long segFileId) throws IOException { Assert.notNull(segFileId, MessagesConstants.ERROR_INVALID_PARAM); Assert.isTrue(segFileId > 0, MessagesConstants.ERROR_INVALID_PARAM); SegFile fileToDelete = segFileManager.load(segFileId); Assert.notNull(fileToDelete, MessagesConstants.ERROR_NO_SUCH_FILE); segFileManager.delete(fileToDelete); fileManager.deleteFeatureFileDirectory(fileToDelete); return fileToDelete; }
SegManager { public SegFile unregisterSegFile(final long segFileId) throws IOException { Assert.notNull(segFileId, MessagesConstants.ERROR_INVALID_PARAM); Assert.isTrue(segFileId > 0, MessagesConstants.ERROR_INVALID_PARAM); SegFile fileToDelete = segFileManager.load(segFileId); Assert.notNull(fileToDelete, MessagesConstants.ERROR_NO_SUCH_FILE); segFileManager.delete(fileToDelete); fileManager.deleteFeatureFileDirectory(fileToDelete); return fileToDelete; } }
SegManager { public SegFile unregisterSegFile(final long segFileId) throws IOException { Assert.notNull(segFileId, MessagesConstants.ERROR_INVALID_PARAM); Assert.isTrue(segFileId > 0, MessagesConstants.ERROR_INVALID_PARAM); SegFile fileToDelete = segFileManager.load(segFileId); Assert.notNull(fileToDelete, MessagesConstants.ERROR_NO_SUCH_FILE); segFileManager.delete(fileToDelete); fileManager.deleteFeatureFileDirectory(fileToDelete); return fileToDelete; }  }
SegManager { public SegFile unregisterSegFile(final long segFileId) throws IOException { Assert.notNull(segFileId, MessagesConstants.ERROR_INVALID_PARAM); Assert.isTrue(segFileId > 0, MessagesConstants.ERROR_INVALID_PARAM); SegFile fileToDelete = segFileManager.load(segFileId); Assert.notNull(fileToDelete, MessagesConstants.ERROR_NO_SUCH_FILE); segFileManager.delete(fileToDelete); fileManager.deleteFeatureFileDirectory(fileToDelete); return fileToDelete; }  SegFile registerSegFile(IndexedFileRegistrationRequest request); SampledTrack<SegRecord> loadFeatures(SampledTrack<SegRecord> track); SegFile unregisterSegFile(final long segFileId); }
SegManager { public SegFile unregisterSegFile(final long segFileId) throws IOException { Assert.notNull(segFileId, MessagesConstants.ERROR_INVALID_PARAM); Assert.isTrue(segFileId > 0, MessagesConstants.ERROR_INVALID_PARAM); SegFile fileToDelete = segFileManager.load(segFileId); Assert.notNull(fileToDelete, MessagesConstants.ERROR_NO_SUCH_FILE); segFileManager.delete(fileToDelete); fileManager.deleteFeatureFileDirectory(fileToDelete); return fileToDelete; }  SegFile registerSegFile(IndexedFileRegistrationRequest request); SampledTrack<SegRecord> loadFeatures(SampledTrack<SegRecord> track); SegFile unregisterSegFile(final long segFileId);  }