本文整理汇总了Java中eu.bitwalker.useragentutils.DeviceType类的典型用法代码示例。如果您正苦于以下问题:Java DeviceType类的具体用法?Java DeviceType怎么用?Java DeviceType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DeviceType类属于eu.bitwalker.useragentutils包,在下文中一共展示了DeviceType类的19个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: supportsWallet
import eu.bitwalker.useragentutils.DeviceType; //导入依赖的package包/类
public boolean supportsWallet(String userAgentHeaderValue) {
if (StringUtils.isBlank(userAgentHeaderValue)) {
return false;
}
UserAgent userAgent = new UserAgent(userAgentHeaderValue);
if (userAgent.getOperatingSystem().getDeviceType() == DeviceType.MOBILE
&& userAgent.getOperatingSystem().getGroup() == OperatingSystem.IOS
&& userAgent.getOperatingSystem().getId() >= OperatingSystem.iOS6_IPHONE.getId()) {
return true;
}
Version oldestSafariVersionWithGuaranteedSupport = new Version("6.2", "6", "2"); // Mac OS X 10.8.2 or later required to install this Safari version
if (userAgent.getOperatingSystem() == OperatingSystem.MAC_OS_X
&& userAgent.getBrowser().getGroup() == Browser.SAFARI
&& userAgent.getBrowserVersion().compareTo(oldestSafariVersionWithGuaranteedSupport) >= 0) {
return true;
}
return false;
}
开发者ID:AusDTO,项目名称:citizenship-appointment-server,代码行数:19,代码来源:WalletSupportService.java
示例2: isMobileOrUnknownDevice
import eu.bitwalker.useragentutils.DeviceType; //导入依赖的package包/类
private boolean isMobileOrUnknownDevice(String userAgentHeaderValue) {
if (StringUtils.isBlank(userAgentHeaderValue)) {
return false;
}
UserAgent userAgent = new UserAgent(userAgentHeaderValue);
return userAgent.getOperatingSystem().getDeviceType() == DeviceType.MOBILE;
}
开发者ID:AusDTO,项目名称:citizenship-appointment-server,代码行数:8,代码来源:ConfirmationController.java
示例3: UserAgentResource
import eu.bitwalker.useragentutils.DeviceType; //导入依赖的package包/类
public UserAgentResource(Browser browser, Browser browserGroup, BrowserType browserType, OperatingSystem operatingSystem, OperatingSystem operatingSystemGroup, DeviceType deviceType) {
this.browser = browser;
this.browserGroup = browserGroup;
this.browserType = browserType;
this.operatingSystem = operatingSystem;
this.operatingSystemGroup = operatingSystemGroup;
this.deviceType = deviceType;
}
开发者ID:theborakompanioni,项目名称:tbk-spring-useragentutils,代码行数:9,代码来源:UserAgentResource.java
示例4: getDeviceType
import eu.bitwalker.useragentutils.DeviceType; //导入依赖的package包/类
public DeviceType getDeviceType() {
return this.deviceType;
}
开发者ID:theborakompanioni,项目名称:tbk-spring-useragentutils,代码行数:4,代码来源:UserAgentResource.java
示例5: isMobileRequest
import eu.bitwalker.useragentutils.DeviceType; //导入依赖的package包/类
public static boolean isMobileRequest(){
return DeviceType.MOBILE.equals(getRequestDeviceType());
}
开发者ID:wayshall,项目名称:onetwo,代码行数:4,代码来源:UserAgentUtils.java
示例6: getRequestDeviceType
import eu.bitwalker.useragentutils.DeviceType; //导入依赖的package包/类
public static DeviceType getRequestDeviceType(){
UserAgent userAgent = getUserAgent();
return userAgent.getOperatingSystem().getDeviceType();
}
开发者ID:wayshall,项目名称:onetwo,代码行数:5,代码来源:UserAgentUtils.java
示例7: getStbView
import eu.bitwalker.useragentutils.DeviceType; //导入依赖的package包/类
public ModelAndView getStbView(HttpServletRequest req, HttpServletResponse resp, String deviceId,
String mobile, String remoteType, String refresh, String uaStr, String stbViewType) {
accessValidator.validateUserHasAccessToDevices(req, resp, true, deviceId);
MetaStb stb = null;
boolean ref = refresh == null ? false : Boolean.parseBoolean(refresh);
try {
stb = metaStbCache.getMetaStb(deviceId, ref);
} catch (HttpRuntimeException e) {
LOGGER.error("Failed to fetch the STB detail.", e);
}
ModelAndView mav;
if (stb == null) {
mav = new ModelAndView(NOSTB);
mav.addObject(DEVICE_ID, deviceId);
} else {
boolean supported = BrowserSupport.isBrowserSupported(uaStr);
String videoUrl = getVideoUrl(stb);
String audioUrlOgg = getAudioUrl(stb, AudioType.OGG);
String audioUrlMpeg = getAudioUrl(stb, AudioType.MPEG);
Boolean mob = false;
if (mobile == null) {
DeviceType deviceType = UserAgent.parseUserAgentString(uaStr).getOperatingSystem().getDeviceType();
mob = deviceType.equals(DeviceType.MOBILE) || deviceType.equals(DeviceType.TABLET);
} else {
mob = Boolean.parseBoolean(mobile);
}
if(remoteType == null) {
remoteType = stb.getRemoteType();
}
Remote remote = getRemote(remoteType);
Set <String> remoteTypes = remoteManager.getRemoteTypes();
mav = new ModelAndView(stbViewType);
mav.addObject(DEVICE_ID, DawgUtil.toLowerAlphaNumeric(deviceId));
try {
mav.addObject(REMOTE_TYPES, jsonEngine.writeToString(remoteTypes, Set.class));
} catch (CerealException exception) {
LOGGER.error("Cereal exception while loading remote types", exception);
}
mav.addObject(STB_PARAM, stb);
mav.addObject(REMOTE_MANAGER, remoteManager);
mav.addObject(REMOTE, remote);
mav.addObject(SELECTED_REMOTE_TYPE, remoteType);
mav.addObject(MOBILE, mob);
mav.addObject(VIDEO_URL, videoUrl);
mav.addObject(VIDEO_AVAILABLE, validUrl(videoUrl) || validUrl(stb.getHdVideoUrl()));
mav.addObject(HD_VIDEO_URL, stb.getHdVideoUrl());
mav.addObject(TRACE_AVAILABLE, validUrl(stb.getSerialHost()));
mav.addObject(TRACE_HOST, stb.getSerialHost());
mav.addObject(IR_AVAILABLE, validUrl(stb.getIrServiceUrl()) && validUrl(stb.getIrServicePort()));
mav.addObject(SUPPORTED, supported);
mav.addObject(IPADDRESS, stb.getIpAddress().getHostName());
mav.addObject(AUDIO_URL_MPEG, audioUrlMpeg);
mav.addObject(AUDIO_URL_OGG, audioUrlOgg);
}
return mav;
}
开发者ID:Comcast,项目名称:dawg,代码行数:64,代码来源:ViewController.java
示例8: getDeviceType
import eu.bitwalker.useragentutils.DeviceType; //导入依赖的package包/类
@Nonnull
public DeviceType getDeviceType() {
return Objects.firstNonNull(getOperatingSystem().getDeviceType(), DeviceType.UNKNOWN);
}
开发者ID:indeedeng,项目名称:proctor-pipet,代码行数:5,代码来源:UserAgent.java
示例9: isTablet
import eu.bitwalker.useragentutils.DeviceType; //导入依赖的package包/类
/**
* Determines whether user agent is a tablet
* @return true if tablet
*/
public boolean isTablet() {
return DeviceType.TABLET.equals(getDeviceType()) ||
userAgentString.contains(NEXUS_7_SIGNATURE) ||
userAgentString.contains(KINDLE_FIRE_SIGNATURE);
}
开发者ID:indeedeng,项目名称:proctor-pipet,代码行数:10,代码来源:UserAgent.java
示例10: getDeviceType
import eu.bitwalker.useragentutils.DeviceType; //导入依赖的package包/类
/**
* 获取设备类型
*
* @param request
* @return
*/
public static DeviceType getDeviceType(HttpServletRequest request) {
return getUserAgent(request).getOperatingSystem().getDeviceType();
}
开发者ID:funtl,项目名称:framework,代码行数:10,代码来源:UserAgentUtils.java
示例11: isComputer
import eu.bitwalker.useragentutils.DeviceType; //导入依赖的package包/类
/**
* 是否是PC
*
* @param request
* @return
*/
public static boolean isComputer(HttpServletRequest request) {
return DeviceType.COMPUTER.equals(getDeviceType(request));
}
开发者ID:funtl,项目名称:framework,代码行数:10,代码来源:UserAgentUtils.java
示例12: isMobile
import eu.bitwalker.useragentutils.DeviceType; //导入依赖的package包/类
/**
* 是否是手机
*
* @param request
* @return
*/
public static boolean isMobile(HttpServletRequest request) {
return DeviceType.MOBILE.equals(getDeviceType(request));
}
开发者ID:funtl,项目名称:framework,代码行数:10,代码来源:UserAgentUtils.java
示例13: isTablet
import eu.bitwalker.useragentutils.DeviceType; //导入依赖的package包/类
/**
* 是否是平板
*
* @param request
* @return
*/
public static boolean isTablet(HttpServletRequest request) {
return DeviceType.TABLET.equals(getDeviceType(request));
}
开发者ID:funtl,项目名称:framework,代码行数:10,代码来源:UserAgentUtils.java
示例14: isMobileOrTablet
import eu.bitwalker.useragentutils.DeviceType; //导入依赖的package包/类
/**
* 是否是手机和平板
*
* @param request
* @return
*/
public static boolean isMobileOrTablet(HttpServletRequest request) {
DeviceType deviceType = getDeviceType(request);
return DeviceType.MOBILE.equals(deviceType) || DeviceType.TABLET.equals(deviceType);
}
开发者ID:funtl,项目名称:framework,代码行数:11,代码来源:UserAgentUtils.java
示例15: getDeviceType
import eu.bitwalker.useragentutils.DeviceType; //导入依赖的package包/类
/**
* 获取设备类型
* @param request
* @return
*/
public static DeviceType getDeviceType(HttpServletRequest request){
return getUserAgent(request).getOperatingSystem().getDeviceType();
}
开发者ID:EleTeam,项目名称:Shop-for-JavaWeb,代码行数:9,代码来源:UserAgentUtils.java
示例16: isComputer
import eu.bitwalker.useragentutils.DeviceType; //导入依赖的package包/类
/**
* 是否是PC
* @param request
* @return
*/
public static boolean isComputer(HttpServletRequest request){
return DeviceType.COMPUTER.equals(getDeviceType(request));
}
开发者ID:EleTeam,项目名称:Shop-for-JavaWeb,代码行数:9,代码来源:UserAgentUtils.java
示例17: isMobile
import eu.bitwalker.useragentutils.DeviceType; //导入依赖的package包/类
/**
* 是否是手机
* @param request
* @return
*/
public static boolean isMobile(HttpServletRequest request){
return DeviceType.MOBILE.equals(getDeviceType(request));
}
开发者ID:EleTeam,项目名称:Shop-for-JavaWeb,代码行数:9,代码来源:UserAgentUtils.java
示例18: isTablet
import eu.bitwalker.useragentutils.DeviceType; //导入依赖的package包/类
/**
* 是否是平板
* @param request
* @return
*/
public static boolean isTablet(HttpServletRequest request){
return DeviceType.TABLET.equals(getDeviceType(request));
}
开发者ID:EleTeam,项目名称:Shop-for-JavaWeb,代码行数:9,代码来源:UserAgentUtils.java
示例19: isMobileOrTablet
import eu.bitwalker.useragentutils.DeviceType; //导入依赖的package包/类
/**
* 是否是手机和平板
* @param request
* @return
*/
public static boolean isMobileOrTablet(HttpServletRequest request){
DeviceType deviceType = getDeviceType(request);
return DeviceType.MOBILE.equals(deviceType) || DeviceType.TABLET.equals(deviceType);
}
开发者ID:EleTeam,项目名称:Shop-for-JavaWeb,代码行数:10,代码来源:UserAgentUtils.java
注:本文中的eu.bitwalker.useragentutils.DeviceType类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论