src/Pure/System/isabelle_system.scala
changeset 45100 0971c3ee3cdf
parent 45027 f459e93a038e
child 45101 6317e969fb30
--- a/src/Pure/System/isabelle_system.scala	Tue Sep 27 22:14:15 2011 +0200
+++ b/src/Pure/System/isabelle_system.scala	Tue Sep 27 22:35:57 2011 +0200
@@ -110,6 +110,16 @@
   def platform_path(path: Path): String = standard_system.jvm_path(standard_path(path))
   def platform_file(path: Path): File = new File(platform_path(path))
 
+  def platform_file_url(raw_path: Path): String =
+  {
+    val path = raw_path.expand
+    require(path.is_absolute)
+    val s =
+      if (Platform.is_windows) "/" + platform_path(path).replace('\\', '/')
+      else platform_path(path)
+    "file://" + s.replaceAll(" ", "%20")
+  }
+
   def posix_path(jvm_path: String): String = standard_system.posix_path(jvm_path)