summaryrefslogtreecommitdiff
path: root/org.tizen.common.project
diff options
context:
space:
mode:
authorJihoon Song <jihoon80.song@samsung.com>2013-08-27 15:56:37 +0900
committerJihoon Song <jihoon80.song@samsung.com>2013-08-29 13:04:07 +0900
commit73015905dbb0e1fb5ac5d6d58ef41d53dcb15074 (patch)
tree409ac6129368a74403bea9d226ecf98c16bfd7f0 /org.tizen.common.project
parent80ef331623e5ff552577c4280fbab8e21478f0fd (diff)
downloadcommon-eplugin-73015905dbb0e1fb5ac5d6d58ef41d53dcb15074.tar.gz
common-eplugin-73015905dbb0e1fb5ac5d6d58ef41d53dcb15074.tar.bz2
common-eplugin-73015905dbb0e1fb5ac5d6d58ef41d53dcb15074.zip
[Title] common-eplugin: fixed project name for app id
[Desc.] [Issue] N_SE-49853 Change-Id: Ia557e1092fe79990f5eecf12f9d2905b06378241
Diffstat (limited to 'org.tizen.common.project')
-rw-r--r--org.tizen.common.project/src/org/tizen/common/project/CommonProjectConstants.java4
-rw-r--r--org.tizen.common.project/src/org/tizen/common/project/util/ProjectValidationUtil.java12
2 files changed, 16 insertions, 0 deletions
diff --git a/org.tizen.common.project/src/org/tizen/common/project/CommonProjectConstants.java b/org.tizen.common.project/src/org/tizen/common/project/CommonProjectConstants.java
index 3e2a49acf..8c0c42fe0 100644
--- a/org.tizen.common.project/src/org/tizen/common/project/CommonProjectConstants.java
+++ b/org.tizen.common.project/src/org/tizen/common/project/CommonProjectConstants.java
@@ -32,6 +32,7 @@ public final class CommonProjectConstants {
public final static int PROJECT_NAME_MIN_LENGTH = 3;
public final static int PROJECT_NAME_MAX_LENGTH = 50;
public final static String PROJECT_NAME_PATTERN;
+ public final static String PROJECT_NAME_PATTERN_FOR_APPID;
public final static char[] INVALID_RESOURCE_CHARACTERS;
@@ -45,6 +46,9 @@ public final class CommonProjectConstants {
// Total character length scope is a minimum of 3 and maximum of 50 characters.
// '.' is allowed but should not end with it - nagative lookbehind (?<!\\.)
+ PROJECT_NAME_PATTERN_FOR_APPID = "^[0-9a-zA-Z]{1,52}$";
+ // This is an App ID specification in the widget configuration
+
INVALID_RESOURCE_CHARACTERS = new char[] { '`', '#', '$', ':' };
}
}
diff --git a/org.tizen.common.project/src/org/tizen/common/project/util/ProjectValidationUtil.java b/org.tizen.common.project/src/org/tizen/common/project/util/ProjectValidationUtil.java
index 9c403e761..6450a20e6 100644
--- a/org.tizen.common.project/src/org/tizen/common/project/util/ProjectValidationUtil.java
+++ b/org.tizen.common.project/src/org/tizen/common/project/util/ProjectValidationUtil.java
@@ -64,6 +64,18 @@ public abstract class ProjectValidationUtil {
}
/**
+ * Validate project name using name pattern for an App ID specification in the widget configuration
+ *
+ * @param projectName
+ * @return If it is valid name, return true.
+ */
+ public static boolean isValidNameForAppID(String projectName) {
+ Assert.notNull( projectName );
+
+ return projectName.matches( CommonProjectConstants.PROJECT_NAME_PATTERN_FOR_APPID );
+ }
+
+ /**
* Validate project name length
*
* @param projectName