Example #1
0
 /**
  * Validates the given uri, throws an appropriate Exception if the uri is invalid.
  *
  * @param uri the uri to validate
  */
 private void validateUri(TachyonURI uri) {
   Preconditions.checkNotNull(uri, "URI cannot be null.");
   Preconditions.checkArgument(
       uri.isPathAbsolute() || TachyonURI.EMPTY_URI.equals(uri),
       "URI must be absolute, unless it's empty.");
   Preconditions.checkArgument(
       !uri.hasScheme() || mRootUri.getScheme().equals(uri.getScheme()),
       "URI's scheme: "
           + uri.getScheme()
           + " must match the file system's scheme: "
           + mRootUri.getScheme()
           + ", unless it doesn't have a scheme.");
   Preconditions.checkArgument(
       !uri.hasAuthority() || mRootUri.getAuthority().equals(uri.getAuthority()),
       "URI's authority: "
           + uri.getAuthority()
           + " must match the file system's authority: "
           + mRootUri.getAuthority()
           + ", unless it doesn't have an authority.");
 }