code: public static Asset getAsset(AssetVersionSpec spec, Map<String,String> attributeValues) {
          Asset match = null;
          try {
              for (Asset asset : getAllAssets()) {
                  if (spec.getName().equals(asset.getName())) {
                      if (asset.meetsVersionSpec(spec.getVersion()) && (match == null || asset.getVersion() > match.getVersion())) {
                          boolean attrsMatch = true;
                          for (String attrName : attributeValues.keySet()) {
                              String attrValue = attributeValues.get(attrName);
                              String rsValue = asset.getAttribute(attrName);
                              if (rsValue == null || !rsValue.equals(attrValue)) {
                                  attrsMatch = false;
                                  break;
                              }
                          }
                          if (attrsMatch && (match == null || match.getVersion() < asset.getVersion())) {
                              if (!asset.isLoaded()) {
                                  Asset loaded = getAsset(asset.getId());
                                  asset.setStringContent(loaded.getStringContent());
                              }
                              match = asset;
                          }
                      }
                  }
              }
    // TODO If match == null, check ASSET_REF DB table to retrieve from git history - For when Asset attributes are implemented
          } catch (DataAccessException ex) {
              logger.severeException("Failed to load asset: "+spec.toString()+ " : "+ex.getMessage(), ex);
          }
          return match;
      }
docs: Get the asset based on version spec whose name and custom attributes match the parameters.