@Test
public void testPersistFile() throws Exception {

  StaticFileServiceImpl staticFileServiceImpl = new StaticFileServiceImpl();
  staticFileServiceImpl.setOrganizationDirectoryService(orgDir);
  staticFileServiceImpl.activate(getComponentContext(null));
  staticFileServiceImpl.setSecurityService(getSecurityService());
  String videoUUID = staticFileServiceImpl.storeFile(videoFilename, new FileInputStream(videoFile));
  String imageUUID = staticFileServiceImpl.storeFile(imageFilename, new FileInputStream(imageFile));
  staticFileServiceImpl.persistFile(videoUUID);
  staticFileServiceImpl.purgeTemporaryStorageSection(getSecurityService().getOrganization().getId(), 0);
  IOUtils.contentEquals(new FileInputStream(videoFile), staticFileServiceImpl.getFile(videoUUID));
  try {
    staticFileServiceImpl.getFile(imageUUID);
    fail("File should no longer exist");
  } catch (NotFoundException e) {
    // expected
  }
}