private long parseFileDate(String age, String fileName, String folderPath) {
        Pattern p = Pattern.compile(" ");
        String [] splitted = p.split(age);
        long count = Long.parseLong(splitted[0]);
        long date = (new Date()).getTime();
        long fileDate = 0;
        long step = 0;
        if (splitted[1].startsWith("second")) {
            step = 1000l;
        } else if (splitted[1].startsWith("minute")) {
            step = 1000l*60;
        } else if (splitted[1].startsWith("hour")) {
            step = 1000l*60*60;
        } else if (splitted[1].startsWith("day")) {
            step = 1000l*60*60*24;
        } else if (splitted[1].startsWith("week")) {
            step = 1000l*60*60*24*7;
        } else if (splitted[1].startsWith("month")) {
            step = 1000l*60*60*24*31;
        } else if (splitted[1].startsWith("year")) {
            step = 1000l*60*60*24*365;
        }
        fileDate = date - (count+1)*step;

        File localFile = new File(getRepositoryFolderName()+"/"+folderPath+"/"+fileName);
        if (localFile.exists() &&
                (Math.abs(fileDate - localFile.lastModified()) < step)) {
            fileDate = localFile.lastModified();
        }
        //System.out.println("datestring: " + splitted[0] + "; "+ splitted[1] + "; count: " +count+ "; date: "+date+"; filedate: "+fileDate);
        return fileDate;
    }