private static Path getCheckedCacheDirectory(String property, Path defaultPath) {
    if (System.getProperty(property) != null) {
      return Paths.get(System.getProperty(property));
    }
    return defaultPath;
  }
Returns the value of a cache directory system property if it is set, otherwise returns {@code
defaultPath}.

@param property the name of the system property to check
@param defaultPath the path to return if the system property isn't set
@return the value of a cache directory system property if it is set, otherwise returns {@code
    defaultPath}
jib-plugins-common/src/main/java/com/google/cloud/tools/jib/plugins/common/PluginConfigurationProcessor.java