aboutsummaryrefslogtreecommitdiff
path: root/interfaces/src/main/java/dotty/tools/dotc/interfaces/AbstractFile.java
diff options
context:
space:
mode:
Diffstat (limited to 'interfaces/src/main/java/dotty/tools/dotc/interfaces/AbstractFile.java')
-rw-r--r--interfaces/src/main/java/dotty/tools/dotc/interfaces/AbstractFile.java24
1 files changed, 24 insertions, 0 deletions
diff --git a/interfaces/src/main/java/dotty/tools/dotc/interfaces/AbstractFile.java b/interfaces/src/main/java/dotty/tools/dotc/interfaces/AbstractFile.java
new file mode 100644
index 000000000..a1b9cc5c7
--- /dev/null
+++ b/interfaces/src/main/java/dotty/tools/dotc/interfaces/AbstractFile.java
@@ -0,0 +1,24 @@
+package dotty.tools.dotc.interfaces;
+
+import java.io.File;
+import java.util.Optional;
+
+/** An abstract file may either be a file on disk or a virtual file.
+ *
+ * Do not rely on the identity of instances of this class.
+ *
+ * User code should not implement this interface, but it may have to
+ * manipulate objects of this type.
+ */
+public interface AbstractFile {
+ /** The name of this file, note that two files may have the same name. */
+ String name();
+
+ /** The path of this file, this might be a virtual path of an unspecified format. */
+ String path();
+
+ /** If this is a real file on disk, a `java.io.File` that corresponds to this file.
+ * Otherwise, an empty `Optional`.
+ */
+ Optional<File> jfile();
+}