Interface HttpVfs

All Known Implementing Classes:
AbstractBlockingHttpVfs, AbstractHttpVfs

public interface HttpVfs
A virtual file system that provides the files requested by FileService.
  • Method Details

    • of

      static HttpVfs of(File rootDir)
      Creates a new HttpVfs with the specified rootDir in an O/S file system.
    • of

      static HttpVfs of(Path rootDir)
      Creates a new HttpVfs with the specified rootDir in an O/S file system.
    • of

      static HttpVfs of(ClassLoader classLoader, String rootDir)
      Creates a new HttpVfs with the specified rootDir in the current class path.
    • get

      @Deprecated HttpFile get(Executor fileReadExecutor, String path, Clock clock, @Nullable @Nullable String contentEncoding, HttpHeaders additionalHeaders)
      Finds the file at the specified path.
      Parameters:
      fileReadExecutor - the Executor which will perform the read operations against the file
      path - an absolute path that starts with '/', whose component separator is '/'
      clock - the Clock which provides the current date and time
      contentEncoding - the desired 'content-encoding' header value of the file. null to omit the header.
      additionalHeaders - the additional HTTP headers to add to the returned HttpFile.
      Returns:
      the HttpFile at the specified path
    • get

      default HttpFile get(Executor fileReadExecutor, String path, Clock clock, @Nullable @Nullable String contentEncoding, HttpHeaders additionalHeaders, MediaTypeResolver mediaTypeResolver)
      Finds the file at the specified path.
      Parameters:
      fileReadExecutor - the Executor which will perform the read operations against the file
      path - an absolute path that starts with '/', whose component separator is '/'
      clock - the Clock which provides the current date and time
      contentEncoding - the desired 'content-encoding' header value of the file. null to omit the header.
      additionalHeaders - the additional HTTP headers to add to the returned HttpFile.
      mediaTypeResolver - the MediaTypeResolver to determine the MediaType.
      Returns:
      the HttpFile at the specified path
    • canList

      CompletableFuture<Boolean> canList(Executor fileReadExecutor, String path)
      Returns whether the file at the specified path is a listable directory.
      Parameters:
      fileReadExecutor - the Executor which will perform the read operations against the file
      path - an absolute path that starts with '/', whose component separator is '/'
      Returns:
      the CompletableFuture that will be completed with true if the file is a listable directory. It will be completed with false if the directory does not exist or the file listing is not available.
    • list

      CompletableFuture<List<String>> list(Executor fileReadExecutor, String path)
      Lists the files at the specified directory path non-recursively.
      Parameters:
      fileReadExecutor - the Executor which will perform the read operations against the file
      path - 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 empty List.
    • meterTag

      String meterTag()
      Returns the value of the "vfs" Tag in a Meter.