Files
auto-subtitle/api/src/main/java/com/github/gtache/autosubtitle/File.java
2024-09-22 21:59:10 +02:00

26 lines
508 B
Java

package com.github.gtache.autosubtitle;
import java.io.IOException;
import java.io.InputStream;
import java.nio.file.Files;
import java.nio.file.Path;
/**
* Represents a file
*/
@FunctionalInterface
public interface File {
/**
* @return The file input stream
* @throws IOException If an I/O error occurs
*/
default InputStream getInputStream() throws IOException {
return Files.newInputStream(path());
}
/**
* @return The file path
*/
Path path();
}