static long deleteObsoleteJRobinFiles(String application) {
		final Calendar nowMinusThreeMonthsAndADay = Calendar.getInstance();
		nowMinusThreeMonthsAndADay.add(Calendar.DAY_OF_YEAR, -getObsoleteGraphsDays());
		nowMinusThreeMonthsAndADay.add(Calendar.DAY_OF_YEAR, -1);
		final long timestamp = Util.getTimestamp(nowMinusThreeMonthsAndADay);
		final int counterRequestIdLength = new CounterRequest("", "").getId().length();
		long diskUsage = 0;
		final Map<String, Long> lastUpdateTimesByPath = new HashMap<>();
		final List<File> rrdFiles = new ArrayList<>(listRrdFiles(application));
		for (final File file : rrdFiles) {
			// on ne supprime que les fichiers rrd de requêtes (les autres sont peu nombreux)
			if (file.getName().length() > counterRequestIdLength
					&& file.lastModified() < nowMinusThreeMonthsAndADay.getTimeInMillis()) {
				final long lastUpdateTime = getLastUpdateTime(file);
				lastUpdateTimesByPath.put(file.getPath(), lastUpdateTime);
				final boolean obsolete = lastUpdateTime < timestamp;
				boolean deleted = false;
				if (obsolete) {
					deleted = file.delete();
				}
				if (!deleted) {
					diskUsage += file.length();
				}
			} else {
				diskUsage += file.length();
			}
		}
		final long maxRrdDiskUsage = getMaxRrdDiskUsageMb() * 1024L * 1024L;
		if (diskUsage > maxRrdDiskUsage) {
			// sort rrd files from least to most recently used
			for (final File file : rrdFiles) {
				if (lastUpdateTimesByPath.get(file.getPath()) == null) {
					lastUpdateTimesByPath.put(file.getPath(), getLastUpdateTime(file));
				}
			}
			rrdFiles.sort(Comparator.comparing(file -> lastUpdateTimesByPath.get(file.getPath())));
			// delete least recently used rrd files until rrd disk usage < 20 MB
			for (final File file : rrdFiles) {
				if (diskUsage < maxRrdDiskUsage) {
					break;
				}
				if (file.getName().length() > counterRequestIdLength) {
					final long length = file.length();
					if (file.delete()) {
						diskUsage -= length;
					}
				}
			}
		}

		return diskUsage;
	}
@Test
	public void testDeleteObsoleteJRobinFiles() {
		JRobin.deleteObsoleteJRobinFiles(TEST_APPLICATION);
		Utils.setProperty(Parameter.OBSOLETE_GRAPHS_DAYS, "1");
		JRobin.deleteObsoleteJRobinFiles(TEST_APPLICATION);
	}