public abstract class


extends Object
implements ContentTreeNode
   ↳ com.atlassian.bitbucket.content.File

Class Overview

Represents a file in a source tree.


Public Constructors
Public Methods
@Nonnull abstract OptionalLong getSize()
Retrieves the size of the file, if sizes were requested.
@Nonnull ContentTreeNode.Type getType()
Inherited Methods
From class java.lang.Object
From interface com.atlassian.bitbucket.content.ContentTreeNode

Public Constructors

public File ()

Public Methods

@Nonnull public abstract OptionalLong 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 be empty().

When using streamDirectory(Repository, String, String, boolean, ContentTreeCallback, PageRequest), file sizes will be returned for non-recursive requests. When using directly, file sizes can be requested or not by setting withSizes(boolean).

  • the size, if requested, or empty()

@Nonnull public ContentTreeNode.Type getType ()

  • Type#FILE