Exemplo n.º 1
0
 public static Pair<DatasetRepository, Map<String, String>> lookupRepoUri(URI repoUri) {
   for (URIPattern pattern : REPO_PATTERNS.keySet()) {
     Map<String, String> match = pattern.getMatch(repoUri);
     if (match != null) {
       return Pair.of(REPO_PATTERNS.get(pattern).getFromOptions(match), match);
     }
   }
   throw new IllegalArgumentException("Unknown repository URI: " + repoUri);
 }
Exemplo n.º 2
0
 public static Pair<DatasetRepository, Map<String, String>> lookupDatasetUri(URI datasetUri) {
   for (URIPattern pattern : DATASET_PATTERNS.keySet()) {
     Map<String, String> match = pattern.getMatch(datasetUri);
     if (match != null) {
       return Pair.of(DATASET_PATTERNS.get(pattern).getFromOptions(match), match);
     }
   }
   throw new DatasetNotFoundException("Unknown dataset URI: " + datasetUri);
 }
Exemplo n.º 3
0
 public static Pair<URIPattern, Map<String, String>> lookupPatternByRepoUri(URI uri) {
   for (URIPattern pattern : REPO_TO_DATASET_PATTERNS.keySet()) {
     Map<String, String> match = pattern.getMatch(uri);
     if (match != null) {
       URIPattern datasetPattern = REPO_TO_DATASET_PATTERNS.get(pattern);
       return Pair.of(datasetPattern, match);
     }
   }
   throw new IllegalArgumentException("Unknown repository URI: " + uri);
 }