lib/jss/api_object/distribution_point.rb
# Check to see if this dist point is reachable for downloads (read-only)
# via either http, if available, or filesharing.
#
# @param pw[String] the read-only password to use for checking the connection
#   If http downloads are enabled, and no http password is required
#   this can be omitted.
#
# @param check_http[Boolean] should we try the http download first, if enabled?
#   If you're intentionally using the ro password for filesharing, and want to check
#   only filesharing, then set this to false.
#
# @return [FalseClass, Symbol] false if not reachable, otherwise :http or :mountable
#
Check to see if this dist point is reachable for downloads (read-only)
via either http, if available, or filesharing.
Check to see if this dist point is reachable for downloads ( read - only ) via either http if available or filesharing .
def reachable_for_download?(pw = '', check_http = true)
      return :http if check_http && http_reachable?(pw)
      return :mountable if mounted?
      return false unless check_pw :ro, pw
      begin
        mount pw, :ro
        :mountable
      rescue
        false
      ensure
        unmount
      end
    end
def reachable_for_download? ( pw = '' , check_http = true ) return :http if check_http && http_reachable? ( pw ) return :mountable if mounted? return false unless check_pw :ro , pw begin mount pw , :ro :mountable rescue false ensure unmount end end
Check to see if this dist point is reachable for downloads (read-only)
via either http, if available, or filesharing.
Check to see if this dist point is reachable for downloads ( read - only ) via either http if available or filesharing .
false if not reachable, otherwise :http or :mountable
false if not reachable otherwise : http or : mountable
FalseClass, Symbol
pw
the read-only password to use for checking the connection If http downloads are enabled, and no http password is required this can be omitted.
the read - only password to use for checking the connection If http downloads are enabled and no http password is required this can be omitted .
check_http
should we try the http download first, if enabled. If you're intentionally using the ro password for filesharing, and want to check only filesharing, then set this to false.
should we try the http download first if enabled . If you ' re intentionally using the ro password for filesharing and want to check only filesharing then set this to false .