code: public static boolean validatePath(String path) {
          if(path == null) {
              Log.w(TAG, "Uploading path not set");
              return false;
          }
  
          try {
              uriFromString(path);
              return true;
          } catch(DataSinkException e) {
              return false;
          }
      }
docs: Returns true if the path is not null and if it is a valid URI.
  
  @param path a URI to validate
  @return true if path is a valid URI.