@@ -877,31 +877,12 @@ public boolean checkContentType(String contentKey, String contentType, String fu
877877
878878 public static boolean isKnownContentType (String type )
879879 {
880- if (type != null )
881- {
882- for (int i = 0 ; i < contentTypes .length ; i ++)
883- {
884- if (contentTypes [i ].length >= 2 )
885- {
886- if (type .equalsIgnoreCase (contentTypes [i ][1 ]))
887- return true ;
888- }
889- }
890- }
891- return false ;
880+ return CommonUtil .isKnownContentType (type );
892881 }
893882
894883 public static String getContentFromExt ( String extension )
895884 {
896- if (extension != null )
897- {
898- extension = extension .toLowerCase ();
899- for (int i = 0 ; i < contentTypes .length ; i ++) {
900- if (contentTypes [i ][0 ].equals (extension .trim ()))
901- return contentTypes [i ][1 ];
902- }
903- }
904- return null ;
885+ return CommonUtil .getContentFromExt (extension );
905886 }
906887
907888 int GX_NULL_TIMEZONEOFFSET = 9999 ;
@@ -913,42 +894,6 @@ public void setRestService()
913894
914895 public boolean isRestService ()
915896 { return restService ; }
916-
917- private static final String contentTypes [][] = {
918- {"txt" , "text/plain" },
919- {"rtx" , "text/richtext" },
920- {"htm" , "text/html" },
921- {"html" , "text/html" },
922- {"xml" , "application/xml" },
923- {"aif" , "audio/x-aiff" },
924- {"au" , "audio/basic" },
925- {"wav" , "audio/wav" },
926- {"bmp" , "image/bmp" },
927- {"gif" , "image/gif" },
928- {"jpe" , "image/jpeg" },
929- {"jpeg" , "image/jpeg" },
930- {"jpg" , "image/jpeg" },
931- {"jfif" , "image/pjpeg" },
932- {"tif" , "image/tiff" },
933- {"tiff" , "image/tiff" },
934- {"png" , "image/x-png" },
935- {"3gp" , "video/3gpp" },
936- {"3g2" , "video/3gpp2" },
937- {"mpg" , "video/mpeg" },
938- {"mpeg" , "video/mpeg" },
939- {"mov" , "video/quicktime" },
940- {"qt" , "video/quicktime" },
941- {"avi" , "video/x-msvideo" },
942- {"exe" , "application/octet-stream" },
943- {"dll" , "application/x-msdownload" },
944- {"ps" , "application/postscript" },
945- {"pdf" , "application/pdf" },
946- {"svg" , "image/svg+xml" },
947- {"tgz" , "application/x-compressed" },
948- {"zip" , "application/x-zip-compressed" },
949- {"gz" , "application/x-gzip" },
950- {"json" , "application/json" }
951- };
952897
953898 public boolean willRedirect ()
954899 {
0 commit comments