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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns available actions for this file (view, download).getFiles()Returns child files when this is a directory and includeChildren istrue .Returns the last modified date of the file.getName()Returns the file name as a link.longgetSize()Returns the file size, or number of items for directories.getType()Returns the type: "dir" or "file".
-
Constructor Details
-
FileResource
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 istrue .- 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
Returns the file name as a link.- Returns:
- The name as a link.
-
getSize
Returns the file size, or number of items for directories.- Returns:
- The size.
-
getType
Returns the type: "dir" or "file".- Returns:
- The type.
-