com.cloudinary.Url.secure()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(2.1k)|赞(0)|评价(0)|浏览(101)

本文整理了Java中com.cloudinary.Url.secure()方法的一些代码示例,展示了Url.secure()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Url.secure()方法的具体详情如下:
包路径:com.cloudinary.Url
类名称:Url
方法名:secure

Url.secure介绍

暂无

代码示例

代码示例来源:origin: cloudinary/cloudinary_android

/**
 * Get a Cloudinary Url object used to construct urls to access and transform pre-uploaded resources.
 */
public Url url() {
  Url url = cloudinary.url();
  // set https as default for android P and up - in P the default policy fails all http
  // requests
  if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
    url.secure(true);
  }
  return url;
}

代码示例来源:origin: cloudinary/cloudinary_java

@Test
public void testSecureDistributionOverwrite() {
  // should allow overwriting secure distribution if secure=TRUE
  String result = cloudinary.url().secure(true).secureDistribution("something.else.com").generate("test");
  assertEquals("https://something.else.com/test123/image/upload/test", result);
}

代码示例来源:origin: cloudinary/cloudinary_java

if (resourceType != null) url.resourceType(resourceType);
if (secure != null) {
  url.secure(secure.booleanValue());
} else if(Boolean.TRUE.equals(isSecureRequest())) {
  url.secure(true);

代码示例来源:origin: cloudinary/cloudinary_java

@Test
public void testSecureDistibution() {
  // should take secure distribution from config if secure=TRUE
  cloudinary.config.secureDistribution = "config.secure.distribution.com";
  String result = cloudinary.url().secure(true).generate("test");
  assertEquals("https://config.secure.distribution.com/test123/image/upload/test", result);
}

代码示例来源:origin: cloudinary/cloudinary_java

@Test
public void testSecureDistribution() {
  // should use default secure distribution if secure=TRUE
  String result = cloudinary.url().secure(true).generate("test");
  assertEquals("https://res.cloudinary.com/test123/image/upload/test", result);
}

代码示例来源:origin: cloudinary/cloudinary_java

@Test
  public void testUrlCloneConfig(){
    // verify that secure (from url.config) is cloned as well:
    Url url = cloudinary.url().cloudName("cloud").format("frmt").publicId("123").secure(true);
    assertEquals("https://res.cloudinary.com/cloud/image/upload/123.frmt", url.clone().generate());
  }
}

相关文章