Author: rob.stryker(a)jboss.com
Date: 2008-10-01 15:55:49 -0400 (Wed, 01 Oct 2008)
New Revision: 10614
Modified:
trunk/archives/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/util/PathUtils.java
Log:
JBIDE-2662 - file system relative paths in archives
Modified:
trunk/archives/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/util/PathUtils.java
===================================================================
---
trunk/archives/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/util/PathUtils.java 2008-10-01
19:07:54 UTC (rev 10613)
+++
trunk/archives/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/util/PathUtils.java 2008-10-01
19:55:49 UTC (rev 10614)
@@ -62,14 +62,22 @@
try {
String translated = ArchivesCore.getInstance().getVFS().
performStringSubstitution(expression, projectName, true);
- if( inWorkspace && version >= 1.2) {
- IPath p = new Path(translated);
- if( !p.isAbsolute() )
- p = new Path(projectName).append(p).makeAbsolute();
- return p.toString();
+ if( inWorkspace ) {
+ if( version >= 1.2) {
+ IPath p = new Path(translated);
+ if( !p.isAbsolute() )
+ p = new Path(projectName).append(p).makeAbsolute();
+ return p.toString();
+ } else {
+ // should be workspace relative already
+ return new Path(translated).makeAbsolute().toString();
+ }
} else {
- // should be workspace relative already
- return new Path(translated).makeAbsolute().toString();
+ if( new Path(translated).isAbsolute())
+ return new Path(translated).toString();
+ // not absolute... hrmm
+ IPath projectPath =
ArchivesCore.getInstance().getVFS().workspacePathToAbsolutePath(new Path(projectName));
+ return projectPath.append(translated).toString();
}
} catch( CoreException ce ) {
// ignore, just return null ce.printStackTrace();
Show replies by date