PluginCompilerMain tested for equality of two directories based equality of
their abstract pathnames. In this case:
"./mootools" is not the same as "././mootools". This change cannoncalizes
the pathnames before carrying out the comparison
http://code.google.com/p/google-caja/source/detail?r=4097
Modified:
/trunk/src/com/google/caja/plugin/PluginCompilerMain.java
/trunk/src/com/google/caja/plugin/UriToFile.java
=======================================
--- /trunk/src/com/google/caja/plugin/PluginCompilerMain.java Wed May 12
15:10:26 2010
+++ /trunk/src/com/google/caja/plugin/PluginCompilerMain.java Fri May 28
17:22:14 2010
@@ -125,6 +125,9 @@
} catch (IllegalArgumentException ex) { // Not a file: URI
fetcher = UriFetcher.NULL_NETWORK;
policy = UriPolicy.CLOSED_PLUGIN_ENVIRONMENT;
+ } catch (IOException e) { // Could not resolve file name
+ fetcher = UriFetcher.NULL_NETWORK;
+ policy = UriPolicy.CLOSED_PLUGIN_ENVIRONMENT;
}
PluginMeta meta = new PluginMeta(fetcher, policy);
=======================================
--- /trunk/src/com/google/caja/plugin/UriToFile.java Tue May 25 12:11:32
2010
+++ /trunk/src/com/google/caja/plugin/UriToFile.java Fri May 28 17:22:14
2010
@@ -17,13 +17,15 @@
import com.google.caja.util.Function;
import java.io.File;
+import java.io.IOException;
import java.net.URI;
class UriToFile implements Function<URI, File> {
final File directory;
- public UriToFile(File directory) {
- this.directory = directory;
+ public UriToFile(File directory) throws IOException {
+ assert directory.isDirectory();
+ this.directory = directory.getCanonicalFile();
}
public File apply(URI uri) {