From c3eb841ce8ae349d9820dbf6c18884955e74254e Mon Sep 17 00:00:00 2001 From: Guillaume Martres Date: Sun, 20 Nov 2016 00:02:50 +0100 Subject: Make every project use the new directory structure --- .../dotty/tools/dotc/interfaces/AbstractFile.java | 24 ++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 interfaces/src/dotty/tools/dotc/interfaces/AbstractFile.java (limited to 'interfaces/src/dotty/tools/dotc/interfaces/AbstractFile.java') diff --git a/interfaces/src/dotty/tools/dotc/interfaces/AbstractFile.java b/interfaces/src/dotty/tools/dotc/interfaces/AbstractFile.java new file mode 100644 index 000000000..286e7b2cf --- /dev/null +++ b/interfaces/src/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 { + /** @return The name of this file, note that two files may have the same name. */ + String name(); + + /** @return The path of this file, this might be a virtual path of an unspecified format. */ + String path(); + + /** @return If this is a real file on disk, a `java.io.File` that corresponds to this file. + * Otherwise, an empty `Optional`. + */ + Optional jfile(); +} -- cgit v1.2.3