Package com.linecorp.armeria.server.file
Interface HttpVfs
- All Known Implementing Classes:
AbstractBlockingHttpVfs
,AbstractHttpVfs
public interface HttpVfs
A virtual file system that provides the files requested by
FileService
.-
Method Summary
Modifier and TypeMethodDescriptionReturns whether the file at the specifiedpath
is a listable directory.get
(Executor fileReadExecutor, String path, Clock clock, @Nullable String contentEncoding, HttpHeaders additionalHeaders) Deprecated.default HttpFile
get
(Executor fileReadExecutor, String path, Clock clock, @Nullable String contentEncoding, HttpHeaders additionalHeaders, MediaTypeResolver mediaTypeResolver) Finds the file at the specifiedpath
.Lists the files at the specified directorypath
non-recursively.meterTag()
Returns the value of the"vfs"
Tag
in aMeter
.static HttpVfs
Creates a newHttpVfs
with the specifiedrootDir
in an O/S file system.static HttpVfs
of
(ClassLoader classLoader, String rootDir) Creates a newHttpVfs
with the specifiedrootDir
in the current class path.static HttpVfs
Creates a newHttpVfs
with the specifiedrootDir
in an O/S file system.
-
Method Details
-
of
Creates a newHttpVfs
with the specifiedrootDir
in an O/S file system. -
of
Creates a newHttpVfs
with the specifiedrootDir
in an O/S file system. -
of
Creates a newHttpVfs
with the specifiedrootDir
in the current class path. -
get
@Deprecated HttpFile get(Executor fileReadExecutor, String path, Clock clock, @Nullable @Nullable String contentEncoding, HttpHeaders additionalHeaders) Deprecated.Finds the file at the specifiedpath
.- Parameters:
fileReadExecutor
- theExecutor
which will perform the read operations against the filepath
- an absolute path that starts with'/'
, whose component separator is'/'
clock
- theClock
which provides the current date and timecontentEncoding
- the desired'content-encoding'
header value of the file.null
to omit the header.additionalHeaders
- the additional HTTP headers to add to the returnedHttpFile
.- Returns:
- the
HttpFile
at the specifiedpath
-
get
default HttpFile get(Executor fileReadExecutor, String path, Clock clock, @Nullable @Nullable String contentEncoding, HttpHeaders additionalHeaders, MediaTypeResolver mediaTypeResolver) Finds the file at the specifiedpath
.- Parameters:
fileReadExecutor
- theExecutor
which will perform the read operations against the filepath
- an absolute path that starts with'/'
, whose component separator is'/'
clock
- theClock
which provides the current date and timecontentEncoding
- the desired'content-encoding'
header value of the file.null
to omit the header.additionalHeaders
- the additional HTTP headers to add to the returnedHttpFile
.mediaTypeResolver
- theMediaTypeResolver
to determine theMediaType
.- Returns:
- the
HttpFile
at the specifiedpath
-
canList
Returns whether the file at the specifiedpath
is a listable directory.- Parameters:
fileReadExecutor
- theExecutor
which will perform the read operations against the filepath
- an absolute path that starts with'/'
, whose component separator is'/'
- Returns:
- the
CompletableFuture
that will be completed withtrue
if the file is a listable directory. It will be completed withfalse
if the directory does not exist or the file listing is not available.
-
list
Lists the files at the specified directorypath
non-recursively.- Parameters:
fileReadExecutor
- theExecutor
which will perform the read operations against the filepath
- an absolute path that starts with'/'
, whose component separator is'/'
- Returns:
- the
CompletableFuture
that will be completed with the list of the file names. If the file is a directory, the file name will end with'/'
. If the directory does not exist or the file listing is not available, it will be completed with an emptyList
.
-
meterTag
String meterTag()Returns the value of the"vfs"
Tag
in aMeter
.
-
get(Executor, String, Clock, String, HttpHeaders, MediaTypeResolver)
instead.