aboutsummaryrefslogtreecommitdiff
path: root/interfaces/src/dotty/tools/dotc/interfaces/AbstractFile.java
blob: 286e7b2cf51df95276a685e8a89d0bf132e4253d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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<File> jfile();
}