Advanced Setting Interface
Last Updated:2020-09-17
Set HttpHeader
public void setHttpHeader(){
String domain="vd3.bdstatic.com";
HttpHeader header1=new HttpHeader().withType("origin").withHeader("x-auth-cn")
.withValue("xxxxxxxxx").withAction("add");
HttpHeader header2=new HttpHeader().withType("response").withHeader("content-type")
.withValue("application/octet-stream").withAction("add");
List<HttpHeader> httpHeaders=new ArrayList<HttpHeader>();
httpHeaders.add(header1);httpHeaders.add(header2);
SetHttpHeaderResponse response = cdnClient.setHttpHeader(domain, httpHeaders);
System.out.println(response);
}
Query HttpHeader
public void getHttpHeader(){
String domain="vd3.bdstatic.com";
GetHttpHeaderResponse response = cdnClient.getHttpHeader(domain);
System.out.println(response);
}
Setting of SEO Switch Properties
public void setSeoSwitch(){
String domain="vd3.bdstatic.com";
SeoSwitch seoSwitch=new SeoSwitch().withDiretlyOrigin("ON").withPushRecord("OFF");
SetSeoSwitchResponse response = cdnClient.setSeoSwitch(domain, seoSwitch);
System.out.println(response);
}
Query SEO Switch Property
public void getSeoSwitch(){
String domain="vd3.bdstatic.com";
GetSeoSwitchResponse response = cdnClient.getSeoSwitch(domain);
System.out.println(response);
}
Set Page Optimization
public void setFileTrim(){
String domain="vd3.bdstatic.com";
SetFileTrimResponse response = cdnClient.setFileTrim(domain, false);
System.out.println(response);
}
Query Page Optimization
public void getFileTrim(){
String domain="vd3.bdstatic.com";
GetFileTrimResponse response = cdnClient.getFileTrim(domain);
System.out.println(response);
}
Set Video Dragging
public void setMediaDrag(){
String domain="vd3.bdstatic.com";
MediaDrag mp4=new MediaDrag().withDragMode("second").withStartArgName("startIndex")
.withFileSuffix(Arrays.asList("mp4","m4a"));
MediaDrag flv=new MediaDrag().withDragMode("byteAV");
MediaDragConf mediaDragConf=new MediaDragConf().withFlv(flv).withMp4(mp4);
SetMediaDragResponse setMediaDragResponse = cdnClient.setMediaDrag(domain, mediaDragConf);
System.out.println(setMediaDragResponse);
}
Query Video Drag
public void getMediaGrag(){
String domain="vd3.bdstatic.com";
GetMediaDragResponse response = cdnClient.getMediaDrag(domain);
System.out.println(response);
}
Page Compression Setting
public void setCompress(){
String domain="vd3.bdstatic.com";
Compress compress=new Compress().withAllow(true).withType("br");
SetCompressResponse setCompressResponse = cdnClient.setCompress(domain, compress);
System.out.println(setCompressResponse);
}
Query Page Compressions
public void getCompress(){
String domain="vd3.bdstatic.com";
GetCompressResponse response = cdnClient.getCompress(domain);
System.out.println(response);
}