Class DirectoryResource.FileResource

java.lang.Object
org.apache.juneau.microservice.examples.DirectoryResource.FileResource
Enclosing class:
DirectoryResource

@Response @Schema(description="File or directory details") @BeanType(properties="type,name,size,lastModified,actions,files") public class DirectoryResource.FileResource extends Object
File or directory details for REST response.
  • Constructor Details

    • FileResource

      public FileResource(File f, String path, boolean includeChildren)
      Constructor.
      Parameters:
      f - The file or directory.
      path - The path.
      includeChildren - Whether to include child files.
  • Method Details

    • getActions

      Returns available actions for this file (view, download).
      Returns:
      The list of actions.
    • getFiles

      Returns child files when this is a directory and includeChildren is true.
      Returns:
      Child files, or null when this is a file or includeChildren is false.
    • getLastModified

      Returns the last modified date of the file.
      Returns:
      The last modified date as an Instant.
    • getName

      public LinkString getName()
      Returns the file name as a link.
      Returns:
      The name as a link.
    • getSize

      public long getSize()
      Returns the file size, or number of items for directories.
      Returns:
      The size.
    • getType

      public String getType()
      Returns the type: "dir" or "file".
      Returns:
      The type.