public abstract class

File

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

Class Overview

Represents a file in a source tree.

Summary

Public Constructors
File()
Public Methods
@Nonnull abstract OptionalLong getSize()
Retrieves the size of the file, if sizes were requested.
@Nonnull ContentTreeNode.Type getType()
[Expand]
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).

Returns
  • the size, if requested, or empty()

@Nonnull public ContentTreeNode.Type getType ()

Returns
  • Type#FILE