我想知道是否有任何方法可以从google app引擎响应标头中删除服务器名称(Google Frontend),以隐藏应用程序部署在GAE上.
google-app-engine httpresponse http-headers response-headers
使用Admin SDK的Directory API更新用户信息时收到错误:
400 BAD_REQUEST
{
"code" : 400,
"errors" : [ {
"domain" : "global",
"message" : "Invalid Input: Bad request for ",
"reason" : "invalid"
} ],
"message" : "Invalid Input: Bad request for "
}
Run Code Online (Sandbox Code Playgroud)
尝试为用户更新组织详细信息,如名称,标题和部门
我的示例代码: `
Get users = directoryService.users().get(userEmail);
User user = users.execute();
try{
List<UserOrganization> userOrg = new ArrayList<UserOrganization>();
userOrg = user.getOrganizations();
if(userOrg != null){
UserOrganization f_userOrg = new UserOrganization();
f_userOrg = userOrg.get(0);
if(f_userOrg != null){
f_userOrg.setTitle("SAP Asso");
f_userOrg.setName("xyz company name");
f_userOrg.setDepartment("xyz dept name"); …
Run Code Online (Sandbox Code Playgroud) java google-app-engine google-admin-sdk google-directory-api
我正在写一个方法.
这是层次结构树:
IProtocoll
|
|--ProtocolImpl1
|
|--ProtocolImpl2
|
|--ProtocolImpl3
Run Code Online (Sandbox Code Playgroud)
该方法本身如下所示:
public static List<IProtocol> getProtocolsByType(String type, Transaction trx) {
Iterator<IProtocol> protocols = trx.getProtocols();
List<IProtocol> protocolsList = new ArrayList<IProtocol>();
while (protocols.hasNext()) {
if (StringHeper.isEqual(protocolls.next().getProtocolType(), type) {
protocolsList.add(protocolls.next());
}
}
return protocolsList
}
Run Code Online (Sandbox Code Playgroud)
和用法示例.
List<IProtocol> list = ProtocolHelper.getrProtocolsByType("PROTOCOL1", trx)
for (IProtocol protocol : list) {
ProtocolHelper.createProtocolType1((ProtocolImpl1) protocol)
}
Run Code Online (Sandbox Code Playgroud)
现在 - 如在类型层次结构中所见 - 这种方法可以返回3种可能性.
String type
正在定义应返回什么类型的协议.trx.getProtocols()
将返回包含所有3种类型协议的迭代器.
有没有办法以某种方式统一这个方法,它将返回这3种类型中的一种,而不使用以后使用该方法时不必要的转换?