/*
 * Copyright 2013 Cloudera Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.kitesdk.data;

import java.net.URI;
import org.kitesdk.data.spi.Registration;

public class Datasets {

  public static <E, D extends Dataset<E>> D load(URI uri) {
    return Registration.<E, D>load(uri);
  }

  public static <E, D extends Dataset<E>> D load(String uriString) {
    return Datasets.<E, D>load(URI.create(uriString));
  }

  public static <E, V extends View<E>> V view(URI uri) {
    return Registration.<E, V>view(uri);
  }

  public static <E, V extends View<E>> V view(String uriString) {
    return Datasets.<E, V>view(URI.create(uriString));
  }
}

@@ -712,105 +712,412 @@
 %0A  p
-ublic static %3CE, D extends Dataset%3CE%3E%3E D load(URI uri) %7B%0A    return Registration.%3CE, D%3Eload(uri);
+rivate static final String DATASET_SCHEME = %22dataset%22;%0A  private static final String VIEW_SCHEME = %22view%22;%0A%0A  public static %3CE, D extends Dataset%3CE%3E%3E D load(URI uri) %7B%0A    if (DATASET_SCHEME.equals(uri.getScheme())) %7B%0A      // accept dataset:%3Cstorage-uri%3E URIs%0A      return Registration.%3CE, D%3Eload(URI.create(uri.getRawSchemeSpecificPart()));%0A    %7D else %7B%0A      return Registration.%3CE, D%3Eload(uri);%0A    %7D
 %0A  %7D
@@ -1300,24 +1300,208 @@
 (URI uri) %7B%0A
+    if (VIEW_SCHEME.equals(uri.getScheme())) %7B%0A      // accept view:%3Cstorage-uri%3E URIs%0A      return Registration.%3CE, V%3Eview(URI.create(uri.getRawSchemeSpecificPart()));%0A    %7D else %7B%0A  
     return R
@@ -1529,16 +1529,22 @@
 w(uri);%0A
+    %7D%0A
   %7D%0A%0A  p

Add optional dataset: and view: URI prefixes.