[Title] Added screen.size feature validation
authorchanghyun1.lee <changhyun1.lee@samsung.com>
Mon, 23 Sep 2013 04:49:45 +0000 (13:49 +0900)
committerchanghyun1.lee <changhyun1.lee@samsung.com>
Mon, 23 Sep 2013 04:49:45 +0000 (13:49 +0900)
[Desc.]
[Issue] Redmine-10227

Change-Id: I487bea50bbee4aea89d6571a3ffb23a1a607c5c1

org.tizen.common/src/org/tizen/common/util/ValidationUtil.java

index 73390f4..dce22fa 100644 (file)
@@ -65,6 +65,9 @@ public class ValidationUtil {
     public static final String WIDGET_ICON_FILE_EXTENSIONS[] = { ".png", ".gif", ".jpg", ".svg", ".ico" }; // http://www.w3.org/TR/widgets/#default-icons
     public static final String WIDGET_ICON_FILTER_EXTENSIONS[] = { "*.png;*.gif;*.jpg;*.svg;*.ico;" }; //http://www.w3.org/TR/widgets/#default-icons
 
+    public static final String WARNING_SCREENSIZE_FEATURES[] = { "http://tizen.org/feature/screen.size.all",
+                                                                "http://tizen.org/feature/screen.size.normal" };
+
     /**
      * Checking for Email address. RFC 2822 (simplified)Matches a normal email address. Does not check the top-level domain.
      *
@@ -166,7 +169,7 @@ public class ValidationUtil {
      * @return {@code true} if icon file extension is valid extension
      */
     public static boolean checkForWidgetIconFileExtension( String iconFileName ) {
-        return ValidationUtil.checkForFileExtension( iconFileName, WIDGET_ICON_FILE_EXTENSIONS );
+        return checkForFileExtension( iconFileName, WIDGET_ICON_FILE_EXTENSIONS );
     }
 
     /**
@@ -176,7 +179,22 @@ public class ValidationUtil {
      * @return {@code true} if content file extension is valid extension
      */
     public static boolean checkForWidgetContentFileExtension( String contentFileName ) {
-        return ValidationUtil.checkForFileExtension( contentFileName, WIDGET_CONTENT_FILE_EXTENSIONS );
+        return checkForFileExtension( contentFileName, WIDGET_CONTENT_FILE_EXTENSIONS );
+    }
+
+    /**
+     * Checking for warning screen.size feature
+     * 
+     * @param feature name
+     * @return {@code true} if featurename contained warning feature list
+     */
+    public static boolean checkForWarningFeature( String featureName ) {
+        for ( String feature : WARNING_SCREENSIZE_FEATURES ) {
+            if ( feature.equalsIgnoreCase( featureName ) ) {
+                return true;
+            }
+        }
+        return false;
     }
 
 }