if (!currentDir.exists() || !currentDir.canRead() || !currentDir.isDirectory())
continue;
String[] logins = currentDir.list(DirectoryFileFilter.DIRECTORY);
for (String login : logins) {
MinimalThesis t = new MinimalThesis();
t.setFieldOfStudy(fieldOfStudy);
t.setThesisCategory(thesisCategory);
t.setFormOfStudy(formOfStudy);
t.setLogin(login);
t.setYear(year);
t.setUploadingUserUsername(((UserDetails) SecurityContextHolder.getContext().getAuthentication().getPrincipal()).getUsername());
try {
thesesDao.insertThesis(t);
thesesDao.updateThesisHasData(t.getId(), true);
b.append("P�idal jsem pr�ci ").append(t.getRelativeThesisPath()).append(".\n");
} catch (DataIntegrityViolationException e) { //pr�ce u� v db je
}
}
}
}