Code example for Date

Methods: getTime

0
        if (!dir.exists() || !dir.isDirectory()) {
            dir.mkdirs();
        } 
        final File f = new File(dir, owner + "_" + name + ".json");
        if (!forceUpdate && f.exists()) {            /* Check if the cached JSON is really old */
            final Date d = new Date();
            final long elderCheck = d.getTime() - (KEEP_LENGTH);
            if (f.lastModified() < elderCheck) {
                shouldRefresh = true;
            } else { 
                try { 
                    final FileInputStream in = new FileInputStream(f);
                    repo = GsonUtils.fromJson(new BufferedReader(
                            new InputStreamReader(in)), Repository.class);
                    in.close();
                    return repo;
                } catch (Exception e) {
                    shouldRefresh = true;
                } 
            } 
        } else {