WEB开发网
开发学院软件开发Java 使用Apache Shindig为客户应用程序加入社区内容 阅读

使用Apache Shindig为客户应用程序加入社区内容

 2010-03-01 00:00:00 来源:WEB开发网   
核心提示: ………………….publicstaticvoidcheckContentTypes(Set<String>allowedContentTypes,StringcontentType,bo

…………………. 
 
public static void
 checkContentTypes(Set<String> allowedContentTypes, 
 
   String contentType, 
boolean
 disallowUnknownContentTypes) 
throws
 InvalidContentTypeException { 
 
 
 
  
if
 (StringUtils.isEmpty(contentType)) { 
 
    
if
 (disallowUnknownContentTypes) { 
 
    
throw
new
 InvalidContentTypeException( 
 
      "No Content-Type specified. One of "
 
        + StringUtils.join(allowedContentTypes, ", ") + " is required"); 
 
    } 
else
 { 
 
     // No content type specified, we can fail in other ways later.
return
; 
 
    } 
 
  } 
 
 
 
  contentType = ContentTypes.extractMimePart(contentType); 
 
 
 
//BL. comented out to support  
 //  if (ContentTypes.FORBIDDEN_CONTENT_TYPES.contains(contentType)) {
 //   throw new InvalidContentTypeException(
 //     "Cannot use disallowed Content-Type " + contentType);
 //  } 
 
..........................................

清单5 修改ContentTypes类

上一页  3 4 5 6 7 8 9 10  下一页

Tags:使用 Apache Shindig

编辑录入:爽爽 [复制链接] [打 印]
赞助商链接