Class File
- All Implemented Interfaces:
ContentTreeNode
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.atlassian.bitbucket.content.ContentTreeNode
ContentTreeNode.Type
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionabstract OptionalLong
getSize()
Retrieves the size of the file, if sizes were requested.getType()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.atlassian.bitbucket.content.ContentTreeNode
getContentId, getPath
-
Constructor Details
-
File
public File()
-
-
Method Details
-
getSize
Retrieves the size of the file, if sizes were requested.For performance reasons, file sizes are not retrieved by default. If they are requested, the returned
OptionalLong
will be set with the file's size. Otherwise, it will beempty()
.When using
ContentService.streamDirectory(com.atlassian.bitbucket.repository.Repository, java.lang.String, java.lang.String, boolean, com.atlassian.bitbucket.content.ContentTreeCallback, com.atlassian.bitbucket.util.PageRequest)
, file sizes will be returned for non-recursive requests. When usingScmCommandFactory.directory(com.atlassian.bitbucket.scm.DirectoryCommandParameters, com.atlassian.bitbucket.content.ContentTreeCallback, com.atlassian.bitbucket.util.PageRequest)
directly, file sizes can be requested or not by settingDirectoryCommandParameters.Builder.withSizes(boolean)
.- Returns:
- the size, if requested, or
empty()
- Since:
- 4.2
-
getType
- Specified by:
getType
in interfaceContentTreeNode
- Returns:
ContentTreeNode.Type.FILE
-