public final class

FileAttachment

extends Object
implements Attachment
java.lang.Object
   ↳ chan.content.model.FileAttachment

Class Overview

Model containing attached file data.

Use setFileUri(ChanLocator, Uri) to store attachment file URI.

Use setThumbnailUri(ChanLocator, Uri) to store attachment thumbnail URI.

If this file contains width, height or size data, you can use setWidth(int), setHeight(int) and setSize(int) respectively to store them.

If this file is embedded frame like YouTube or Vocaroo, use EmbeddedAttachment class.

Summary

Public Constructors
FileAttachment()
Public Methods
Uri getFileUri(ChanLocator locator)

Returns attachment file URI.

int getHeight()

Returns file height in pixels.

String getOriginalName()

Returns original file name (file name before uploading).

int getSize()

Returns file size in bytes.

Uri getThumbnailUri(ChanLocator locator)

Returns attachment thumbnail URI.

int getWidth()

Returns file width in pixels.

boolean isSpoiler()

Returns whether file is spoiler.

FileAttachment setFileUri(ChanLocator locator, Uri fileUri)

Encodes and stores attachment file URI in this model.

FileAttachment setHeight(int height)

Stores file height in this model.

FileAttachment setOriginalName(String originalName)

Stores original file name (file name before uploading) in this model.

FileAttachment setSize(int size)

Stores file size in bytes in this model.

FileAttachment setSpoiler(boolean spoiler)

Stores whether file is spoiler in this model.

FileAttachment setThumbnailUri(ChanLocator locator, Uri thumbnailUri)

Encodes and stores attachment thumbnail URI in this model.

FileAttachment setWidth(int width)

Stores file width in this model.

[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public FileAttachment ()

Public Methods

public Uri getFileUri (ChanLocator locator)

Returns attachment file URI.

Parameters
locator ChanLocator: ChanLocator instance to decode URI in model.
Returns
Uri

public int getHeight ()

Returns file height in pixels.

Returns
int

public String getOriginalName ()

Returns original file name (file name before uploading).

Returns
String

public int getSize ()

Returns file size in bytes.

Returns
int

public Uri getThumbnailUri (ChanLocator locator)

Returns attachment thumbnail URI.

Parameters
locator ChanLocator: ChanLocator instance to decode URI in model.
Returns
Uri

public int getWidth ()

Returns file width in pixels.

Returns
int

public boolean isSpoiler ()

Returns whether file is spoiler.

Returns
boolean

public FileAttachment setFileUri (ChanLocator locator, Uri fileUri)

Encodes and stores attachment file URI in this model.

Parameters
locator ChanLocator: ChanLocator instance to encode URI in model.
fileUri Uri: Attachment file URI.
Returns
FileAttachment This model.

public FileAttachment setHeight (int height)

Stores file height in this model.

Parameters
height int: File height in pixels.
Returns
FileAttachment This model.

public FileAttachment setOriginalName (String originalName)

Stores original file name (file name before uploading) in this model.

Parameters
originalName String: Original file name.
Returns
FileAttachment This model.

public FileAttachment setSize (int size)

Stores file size in bytes in this model.

Parameters
size int: File size in bytes.
Returns
FileAttachment This model.

public FileAttachment setSpoiler (boolean spoiler)

Stores whether file is spoiler in this model.

Parameters
spoiler boolean: True if file is spoiler, false otherwise.
Returns
FileAttachment This model.

public FileAttachment setThumbnailUri (ChanLocator locator, Uri thumbnailUri)

Encodes and stores attachment thumbnail URI in this model.

Parameters
locator ChanLocator: ChanLocator instance to encode URI in model.
thumbnailUri Uri: Attachment thumbnail URI.
Returns
FileAttachment This model.

public FileAttachment setWidth (int width)

Stores file width in this model.

Parameters
width int: File width in pixels.
Returns
FileAttachment This model.