private void preAwardCredits(DirectoryHandle preDir, HashMap<User, Long> awards) { try { for (InodeHandle file : preDir.getInodeHandlesUnchecked()) { if (file.isFile()) { User owner; try { owner = GlobalContext.getGlobalContext() .getUserManager() .getUserByNameUnchecked(file.getUsername()); } catch (NoSuchUserException e) { logger.warn("PRE: Cannot award credits to non-existing user", e); continue; } catch (UserFileException e) { logger.warn("", e); continue; } catch (FileNotFoundException e) { logger.warn("", e); continue; } Long total = awards.get(owner); if (total == null) { total = 0L; } total = (total + (long) (file.getSize() * owner.getKeyedMap().getObjectFloat(UserManagement.RATIO))); awards.put(owner, total); } if (file.isDirectory()) { preAwardCredits((DirectoryHandle) file, awards); } } } catch (FileNotFoundException e) { logger.warn("FileNotFoundException on preAwardCredits()", e); } }