private List<ResolvedArtifact> load() {
        // Invalidate the cache if:
        // 1. smithy-build.json was updated after the cache was written.
        // 2. the cache file is older than the allowed TTL.
        // 3. a cached artifact was deleted.
        // 4. a cached artifact is newer than the cache file.
        long cacheLastModifiedMillis = location.lastModified();
        long currentTimeMillis = new Date().getTime();
        long ttlMillis = SMITHY_MAVEN_TTL.toMillis();

        if (location.length() == 0) {
            return Collections.emptyList();
        } else if (!isCacheValid(cacheLastModifiedMillis)) {
            LOGGER.fine("Invalidating dependency cache: config is newer than the cache");
            invalidate();
            return Collections.emptyList();
        } else if (currentTimeMillis - cacheLastModifiedMillis > ttlMillis) {
            LOGGER.fine(() -> "Invalidating dependency cache: Cache exceeded TTL (TTL: " + ttlMillis + ")");
            invalidate();
            return Collections.emptyList();
        }

        ObjectNode node;
        try (InputStream stream = Files.newInputStream(location.toPath())) {
            node = Node.parse(stream, location.toString()).expectObjectNode();
        } catch (ModelSyntaxException | IOException e) {
            throw new DependencyResolverException("Error loading dependency cache file from " + location, e);
        }

        // If the version of the cache file does not match the current version or does not exist
        // invalidate it so we can replace it with a more recent version.
        if (!node.containsMember("version")
                || !CURRENT_CACHE_FILE_VERSION.equals(node.expectStringMember("version").getValue())) {
            LOGGER.fine(() -> "Invalidating dependency cache: cache file uses old version");
            invalidate();
            return Collections.emptyList();
        }

        ObjectNode artifactNode = node.expectObjectMember("artifacts");
        List<ResolvedArtifact> result = new ArrayList<>(artifactNode.getStringMap().size());
        for (Map.Entry<String, Node> entry : artifactNode.getStringMap().entrySet()) {
            ResolvedArtifact artifact = ResolvedArtifact.fromCoordinateNode(entry.getKey(), entry.getValue());
            long lastModifiedOfArtifact = artifact.getLastModified();
            // Invalidate the cache if the JAR file was updated since the cache was created.
            if (lastModifiedOfArtifact == 0 || lastModifiedOfArtifact > cacheLastModifiedMillis) {
                LOGGER.fine(() -> "Invalidating dependency cache: artifact is newer than cache: " + artifact.getPath());
                invalidate();
                return Collections.emptyList();
            }
            result.add(artifact);
        }

        return result;
    }
@param location The location to the cache.
@param referenceTimeInMillis Invalidate cache items if this time is newer than the cache item time.
@param delegate Resolver to delegate to when dependencies aren't cached.
smithy-cli/src/main/java/software/amazon/smithy/cli/dependencies/FileCacheResolver.java