[jboss-cvs] jbosside/core/plugins/org.jboss.ide.eclipse.core/src/main/org/jboss/ide/eclipse/core/util ...
Robert Stryker
rob.stryker at jboss.com
Fri Feb 23 13:31:57 EST 2007
User: rawb
Date: 07/02/23 13:31:57
Modified: core/plugins/org.jboss.ide.eclipse.core/src/main/org/jboss/ide/eclipse/core/util
ResourceUtil.java
Log:
changed behavior for both or neither matching
Revision Changes Path
1.6 +12 -2 jbosside/core/plugins/org.jboss.ide.eclipse.core/src/main/org/jboss/ide/eclipse/core/util/ResourceUtil.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: ResourceUtil.java
===================================================================
RCS file: /cvsroot/jboss/jbosside/core/plugins/org.jboss.ide.eclipse.core/src/main/org/jboss/ide/eclipse/core/util/ResourceUtil.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- ResourceUtil.java 23 Feb 2007 18:23:00 -0000 1.5
+++ ResourceUtil.java 23 Feb 2007 18:31:57 -0000 1.6
@@ -105,6 +105,16 @@
public static final boolean WORKSPACE_DEFAULT = true;
public static final boolean GLOBAL_DEFAULT = false;
+
+ /**
+ * Makes a path absolute.
+ * If the path exists in workspace and assumption = workspace, append workspace root
+ * If the path exists in filesystem and assumption = global, return unchanged
+ * If both or neither, follow the assumption for behavior.
+ * @param path
+ * @param assumption
+ * @return
+ */
public static IPath makeAbsolute(IPath path, boolean assumption) {
boolean inWorkspace = isResourceInWorkspace(path);
boolean fileExists = new File(path.toOSString()).exists();
@@ -115,7 +125,7 @@
return path;
}
- // neither are true. return unchanged path;
- return path;
+ if( assumption == GLOBAL_DEFAULT ) return path;
+ return ResourcesPlugin.getWorkspace().getRoot().getLocation().append(path);
}
}
More information about the jboss-cvs-commits
mailing list