From b6ec18f74a9aec31278d1c89870aca20ef5d7535 Mon Sep 17 00:00:00 2001 From: "ho.namkoong" Date: Tue, 9 Oct 2012 17:40:19 +0900 Subject: [PATCH] [Title] Make util method which tells whether project is in default location or not. For using in express mode of wizard [Type] [Module] [Priority] [Jira#] [Redmine#] 6479 [Problem] [Cause] [Solution] [TestCase] Change-Id: Ifa59a81cfaba56155640e42e452e5c755b224025 --- .../src/org/tizen/common/util/ProjectUtil.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/org.tizen.common/src/org/tizen/common/util/ProjectUtil.java b/org.tizen.common/src/org/tizen/common/util/ProjectUtil.java index 31acf7d..96f8e66 100644 --- a/org.tizen.common/src/org/tizen/common/util/ProjectUtil.java +++ b/org.tizen.common/src/org/tizen/common/util/ProjectUtil.java @@ -31,7 +31,9 @@ import org.eclipse.core.resources.ICommand; import org.eclipse.core.resources.IProject; import org.eclipse.core.resources.IProjectDescription; import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.core.runtime.Platform; import org.tizen.common.util.log.Logger; /** @@ -196,4 +198,16 @@ public class ProjectUtil { return null; } + + /** + * Check whether target project is located in default location or not. + * @param descriptionLocation .cproject location of target project. + * @return true if it is located in default location. False if not. + */ + public static boolean isDefaultProjectLocation(IPath descriptionLocation) { + if(descriptionLocation.segmentCount() < 2) { + return false; + } + return descriptionLocation.removeLastSegments(2).toFile().equals(Platform.getLocation().toFile()); + } } -- 2.7.4