|
6 | 6 | package dotty.tools.io |
7 | 7 |
|
8 | 8 | import java.net.URL |
9 | | -import java.io.{ IOException, InputStream, FilterInputStream } |
| 9 | +import java.io.{ IOException, InputStream, OutputStream, FilterInputStream } |
10 | 10 | import java.nio.file.Files |
11 | 11 | import java.util.zip.{ ZipEntry, ZipFile } |
12 | 12 | import java.util.jar.Manifest |
@@ -55,27 +55,27 @@ import ZipArchive._ |
55 | 55 | abstract class ZipArchive(override val jpath: JPath) extends AbstractFile with Equals { |
56 | 56 | self => |
57 | 57 |
|
58 | | - override def underlyingSource: Some[ZipArchive] = Some(this) |
| 58 | + override def underlyingSource: Option[ZipArchive] = Some(this) |
59 | 59 | def isDirectory: Boolean = true |
60 | 60 | def lookupName(name: String, directory: Boolean): AbstractFile = unsupported() |
61 | 61 | def lookupNameUnchecked(name: String, directory: Boolean): AbstractFile = unsupported() |
62 | 62 | def create(): Unit = unsupported() |
63 | 63 | def delete(): Unit = unsupported() |
64 | | - def output: Nothing = unsupported() |
65 | | - def container: Nothing = unsupported() |
66 | | - def absolute: Nothing = unsupported() |
| 64 | + def output: OutputStream = unsupported() |
| 65 | + def container: AbstractFile = unsupported() |
| 66 | + def absolute: AbstractFile = unsupported() |
67 | 67 |
|
68 | 68 | /** ''Note: This library is considered experimental and should not be used unless you know what you are doing.'' */ |
69 | 69 | sealed abstract class Entry(path: String) extends VirtualFile(baseName(path), path) { |
70 | 70 | // have to keep this name for compat with sbt's compiler-interface |
71 | 71 | def getArchive: ZipFile = null |
72 | | - override def underlyingSource: Some[ZipArchive] = Some(self) |
| 72 | + override def underlyingSource: Option[ZipArchive] = Some(self) |
73 | 73 | override def toString: String = self.path + "(" + path + ")" |
74 | 74 | } |
75 | 75 |
|
76 | 76 | /** ''Note: This library is considered experimental and should not be used unless you know what you are doing.'' */ |
77 | 77 | class DirEntry(path: String) extends Entry(path) { |
78 | | - val entries: mutable.HashMap[String, Entry] = mutable.HashMap[String, Entry]() |
| 78 | + val entries: mutable.HashMap[String, Entry] = mutable.HashMap() |
79 | 79 |
|
80 | 80 | override def isDirectory: Boolean = true |
81 | 81 | override def iterator: Iterator[Entry] = entries.valuesIterator |
@@ -147,7 +147,7 @@ final class FileZipArchive(jpath: JPath) extends ZipArchive(jpath) { |
147 | 147 | override def sizeOption: Option[Int] = Some(zipEntry.getSize.toInt) |
148 | 148 | } |
149 | 149 |
|
150 | | - @volatile lazy val ((root: DirEntry), (allDirs: mutable.HashMap[String, DirEntry])) = { |
| 150 | + @volatile lazy val (root, allDirs): (DirEntry, collection.Map[String, DirEntry]) = { |
151 | 151 | val root = new DirEntry("/") |
152 | 152 | val dirs = mutable.HashMap[String, DirEntry]("/" -> root) |
153 | 153 | val zipFile = openZipFile() |
@@ -180,12 +180,12 @@ final class FileZipArchive(jpath: JPath) extends ZipArchive(jpath) { |
180 | 180 |
|
181 | 181 | def iterator: Iterator[Entry] = root.iterator |
182 | 182 |
|
183 | | - def name: String = jpath.getFileName.toString |
184 | | - def path: String = jpath.toString |
185 | | - def input: java.io.InputStream = Files.newInputStream(jpath) |
186 | | - def lastModified: Long = Files.getLastModifiedTime(jpath).toMillis |
| 183 | + def name: String = jpath.getFileName.toString |
| 184 | + def path: String = jpath.toString |
| 185 | + def input: InputStream = Files.newInputStream(jpath) |
| 186 | + def lastModified: Long = Files.getLastModifiedTime(jpath).toMillis |
187 | 187 |
|
188 | | - override def sizeOption: Some[Int] = Some(Files.size(jpath).toInt) |
| 188 | + override def sizeOption: Option[Int] = Some(Files.size(jpath).toInt) |
189 | 189 | override def canEqual(other: Any): Boolean = other.isInstanceOf[FileZipArchive] |
190 | 190 | override def hashCode(): Int = jpath.hashCode |
191 | 191 | override def equals(that: Any): Boolean = that match { |
|
0 commit comments