當前位置: 首頁>>代碼示例>>Java>>正文


Java ServiceInfo.getPropertyString方法代碼示例

本文整理匯總了Java中javax.jmdns.ServiceInfo.getPropertyString方法的典型用法代碼示例。如果您正苦於以下問題:Java ServiceInfo.getPropertyString方法的具體用法?Java ServiceInfo.getPropertyString怎麽用?Java ServiceInfo.getPropertyString使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在javax.jmdns.ServiceInfo的用法示例。


在下文中一共展示了ServiceInfo.getPropertyString方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: addFDroidService

import javax.jmdns.ServiceInfo; //導入方法依賴的package包/類
/**
 * Broadcasts the fact that a Bonjour peer was found to swap with.
 * Checks that the service is an F-Droid service, and also that it is not the F-Droid service
 * for this device (by comparing its signing fingerprint to our signing fingerprint).
 */
private void addFDroidService(ServiceInfo serviceInfo) {
    final String type = serviceInfo.getPropertyString("type");
    final String fingerprint = serviceInfo.getPropertyString("fingerprint");
    final boolean isFDroid = type != null && type.startsWith("fdroidrepo");
    final boolean isSelf = FDroidApp.repo != null && fingerprint != null && fingerprint.equalsIgnoreCase(FDroidApp.repo.fingerprint);
    if (isFDroid && !isSelf) {
        Utils.debugLog(TAG, "Found F-Droid swap Bonjour service:\n" + serviceInfo);
        subscriber.onNext(new BonjourPeer(serviceInfo));
    } else {
        if (isSelf) {
            Utils.debugLog(TAG, "Ignoring Bonjour service because it belongs to this device:\n" + serviceInfo);
        } else {
            Utils.debugLog(TAG, "Ignoring Bonjour service because it doesn't look like an F-Droid swap repo:\n" + serviceInfo);
        }
    }
}
 
開發者ID:uhuru-mobile,項目名稱:mobile-store,代碼行數:22,代碼來源:BonjourFinder.java

示例2: addFDroidService

import javax.jmdns.ServiceInfo; //導入方法依賴的package包/類
/**
 * Broadcasts the fact that a Bonjour peer was found to swap with.
 * Checks that the service is an F-Droid service, and also that it is not the F-Droid service
 * for this device (by comparing its signing fingerprint to our signing fingerprint).
 */
private void addFDroidService(ServiceInfo serviceInfo) {
    final String type = serviceInfo.getPropertyString("type");
    final String fingerprint = serviceInfo.getPropertyString("fingerprint");
    final boolean isFDroid = type != null && type.startsWith("fdroidrepo");
    final boolean isSelf = FDroidApp.REPO != null && fingerprint != null && fingerprint.equalsIgnoreCase(FDroidApp.REPO.fingerprint);
    if (isFDroid && !isSelf) {
        Utils.debugLog(TAG, "Found F-Droid swap Bonjour service:\n" + serviceInfo);
        subscriber.onNext(new BonjourPeer(serviceInfo));
    } else {
        if (isSelf) {
            Utils.debugLog(TAG, "Ignoring Bonjour service because it belongs to this device:\n" + serviceInfo);
        } else {
            Utils.debugLog(TAG, "Ignoring Bonjour service because it doesn't look like an F-Droid swap repo:\n" + serviceInfo);
        }
    }
}
 
開發者ID:CmDnoEdition,項目名稱:fdroid,代碼行數:22,代碼來源:BonjourFinder.java

示例3: addFDroidService

import javax.jmdns.ServiceInfo; //導入方法依賴的package包/類
/**
 * Broadcasts the fact that a Bonjour peer was found to swap with.
 * Checks that the service is an F-Droid service, and also that it is not the F-Droid service
 * for this device (by comparing its signing fingerprint to our signing fingerprint).
 */
private void addFDroidService(ServiceInfo serviceInfo) {
    final String type = serviceInfo.getPropertyString("type");
    final String fingerprint = serviceInfo.getPropertyString("fingerprint");
    final boolean isFDroid = type != null && type.startsWith("fdroidrepo");
    final boolean isSelf = FDroidApp.repo != null && fingerprint != null && fingerprint.equalsIgnoreCase(FDroidApp.repo.fingerprint);
    if (isFDroid && !isSelf) {
        Utils.debugLog(TAG, "Found F-Droid swap Bonjour service:\n" + serviceInfo);
        foundPeer(new BonjourPeer(serviceInfo));
    } else {
        if (isSelf) {
            Utils.debugLog(TAG, "Ignoring Bonjour service because it belongs to this device:\n" + serviceInfo);
        } else {
            Utils.debugLog(TAG, "Ignoring Bonjour service because it doesn't look like an F-Droid swap repo:\n" + serviceInfo);
        }
    }
}
 
開發者ID:nutellarlz,項目名稱:AppHub,代碼行數:22,代碼來源:BonjourFinder.java

示例4: SPServerInfo

import javax.jmdns.ServiceInfo; //導入方法依賴的package包/類
public SPServerInfo(ServiceInfo si) {
	scheme = "http";
    name = si.getName();
    serverAddress = si.getHostAddress();
    port = si.getPort();
    path = si.getPropertyString("path");
    username = null;
    password = null;
    passwordAllowed = true;
}
 
開發者ID:SQLPower,項目名稱:sqlpower-library,代碼行數:11,代碼來源:SPServerInfo.java


注:本文中的javax.jmdns.ServiceInfo.getPropertyString方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。