Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(23)

Unified Diff: editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/internal/util/ResourceUtil.java

Issue 284123007: Merge r36248 into trunk. (Closed) Base URL: https://dart.googlecode.com/svn/trunk/dart
Patch Set: Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/internal/util/ResourceUtil.java
diff --git a/editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/internal/util/ResourceUtil.java b/editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/internal/util/ResourceUtil.java
index 680fb6592e139f73d61f5c58224f1c56e61ea561..205138c15b499d0701af1351c7bab1e598767e62 100644
--- a/editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/internal/util/ResourceUtil.java
+++ b/editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/internal/util/ResourceUtil.java
@@ -116,7 +116,16 @@ public class ResourceUtil {
if (file == null) {
return null;
}
- return getResource(getCanonicalUri(file));
+ if (file.isDirectory()) {
+ return getResource(getCanonicalUri(file));
+ } else {
+ IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot();
+ IFile[] files = workspaceRoot.findFilesForLocationURI(file.toURI());
+ if (files.length == 0) {
+ return null;
+ }
+ return files[0];
+ }
}
/**
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698