src/Pure/General/file.scala
changeset 75701 84990c95712d
parent 75677 347f9fde03dd
child 75823 6eb8d6cdb686
equal deleted inserted replaced
75700:953953504590 75701:84990c95712d
    11   OutputStream, InputStream, FileInputStream, BufferedInputStream, BufferedReader,
    11   OutputStream, InputStream, FileInputStream, BufferedInputStream, BufferedReader,
    12   InputStreamReader, File => JFile, IOException}
    12   InputStreamReader, File => JFile, IOException}
    13 import java.nio.file.{StandardOpenOption, Path => JPath, Files, SimpleFileVisitor,
    13 import java.nio.file.{StandardOpenOption, Path => JPath, Files, SimpleFileVisitor,
    14   FileVisitOption, FileVisitResult}
    14   FileVisitOption, FileVisitResult}
    15 import java.nio.file.attribute.BasicFileAttributes
    15 import java.nio.file.attribute.BasicFileAttributes
    16 import java.net.{URL, MalformedURLException}
    16 import java.net.{URI, URL, MalformedURLException}
    17 import java.util.zip.{GZIPInputStream, GZIPOutputStream}
    17 import java.util.zip.{GZIPInputStream, GZIPOutputStream}
    18 import java.util.EnumSet
    18 import java.util.EnumSet
    19 
    19 
    20 import org.tukaani.xz.{XZInputStream, XZOutputStream}
    20 import org.tukaani.xz.{XZInputStream, XZOutputStream}
    21 
    21 
    59   def canonical(file: JFile): JFile = file.getCanonicalFile
    59   def canonical(file: JFile): JFile = file.getCanonicalFile
    60   def canonical_name(file: JFile): String = canonical(file).getPath
    60   def canonical_name(file: JFile): String = canonical(file).getPath
    61 
    61 
    62   def path(file: JFile): Path = Path.explode(standard_path(file))
    62   def path(file: JFile): Path = Path.explode(standard_path(file))
    63   def pwd(): Path = path(Path.current.absolute_file)
    63   def pwd(): Path = path(Path.current.absolute_file)
       
    64 
       
    65   def uri(file: JFile): URI = file.toURI
       
    66   def uri(path: Path): URI = path.file.toURI
       
    67 
       
    68   def url(file: JFile): URL = uri(file).toURL
       
    69   def url(path: Path): URL = url(path.file)
    64 
    70 
    65 
    71 
    66   /* relative paths */
    72   /* relative paths */
    67 
    73 
    68   def relative_path(base: Path, other: Path): Option[Path] = {
    74   def relative_path(base: Path, other: Path): Option[Path] = {