当前位置: 首页>>代码示例>>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;未经允许,请勿转载。