private void getFileContent(FileRecord file) throws DigitalLibraryException, IOException, NotFoundException, AccessDeniedException { HibernateUtil.getSessionFactory().getCurrentSession().getTransaction().begin(); try { InputStream f = dl.getFileContents(RO_URI, file.path); assertNotNull(f); f.close(); assertEquals(file.mimeType, dl.getFileInfo(RO_URI, file.path).getMimeType()); } finally { HibernateUtil.getSessionFactory().getCurrentSession().getTransaction().commit(); } }