Пример #1
0
 private void checkNoFile(String path) throws DigitalLibraryException, IOException {
   HibernateUtil.getSessionFactory().getCurrentSession().getTransaction().begin();
   try {
     dl.getFileContents(RO_URI, path).close();
     fail("Deleted file doesn't throw IdNotFoundException");
   } catch (NotFoundException e) {
     // good
   } finally {
     HibernateUtil.getSessionFactory().getCurrentSession().getTransaction().commit();
   }
 }
Пример #2
0
 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();
   }
 }