Package ratpack.file

Interface FileSystemBinding


  • public interface FileSystemBinding
    A file system binding represents a file system location that is used to resolve relative paths. Every exchange has a file system binding available via its service, as every Ratpack app has a file system binding.

    The file system binding is used by asset serving handlers, among other places.

    See Also:
    Chain.files(ratpack.func.Action)
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static com.google.common.reflect.TypeToken<FileSystemBinding> TYPE
      A type token for this type.
    • Field Detail

      • TYPE

        static final com.google.common.reflect.TypeToken<FileSystemBinding> TYPE
        A type token for this type.
        Since:
        1.1
    • Method Detail

      • getFile

        java.nio.file.Path getFile()
        The actual point on the filesystem that this binding is bound to.
        Returns:
        The actual point on the filesystem that this binding is bound to.
      • file

        @Nullable
        java.nio.file.Path file​(java.lang.String path)
        Creates a file reference relative to the bind point denoted by the given relative path. Absolute paths are resolved relative to the bind point, not the filesystem root.
        Parameters:
        path - The relative path from this binding to the desired file
        Returns:
        The file
      • binding

        FileSystemBinding binding​(java.lang.String path)
        Construct a new binding by using the given path as a relative path from this bind point. Absolute paths are resolved relative to the bind point, not the filesystem root.

        Prefer using Context.file(String).

        Parameters:
        path - The relative path from this binding to the desired binding
        Returns:
        The binding