public class

LinkedFile

extends Object
java.lang.Object
   ↳ com.kinvey.java.LinkedResources.LinkedFile

Class Overview

This class maintains metadata and java specific file access to a File associated with an Entity through the com.kinvey.java.LinkedData API. There are references to a `ByteArrayInputStream as well as a `ByteArrayOutputStream`, which can be used to stream to/from the file. NOTE: It is the responsibility of the client application to close these streams appropriately after usage.

Summary

Public Constructors
LinkedFile(String id)
Constructor for a LinkedFile, sets BOTH filename and id to be input
LinkedFile()
Constructor for a LinkedFile, sets NEITHER a filename or an id
LinkedFile(String id, String filename)
Constructor for LinkedFile, allowing unique id and filename
Public Methods
void addExtra(String key, Object value)
Add an extra property to this KinveyFile.
Object getExtra(String key)
Retrieve an extra property by key associated with this KinveyFile.
HashMap<String, Object> getExtras()
String getFileName()
String getId()
Get the id of a Linked File
ByteArrayInputStream getInput()
ByteArrayOutputStream getOutput()
boolean hasExtras()
boolean isResolve()
void setFileName(String fileName)
void setId(String id)
void setInput(ByteArrayInputStream input)
void setOutput(ByteArrayOutputStream output)
void setResolve(boolean resolve)
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public LinkedFile (String id)

Constructor for a LinkedFile, sets BOTH filename and id to be input

Parameters
id - the filename which is also used as the id

public LinkedFile ()

Constructor for a LinkedFile, sets NEITHER a filename or an id

public LinkedFile (String id, String filename)

Constructor for LinkedFile, allowing unique id and filename

Parameters
id the id to use for the linked file
filename the filename of the linkedfile

Public Methods

public void addExtra (String key, Object value)

Add an extra property to this KinveyFile. When the File is uploaded through LinkedData, any extra properties here will be added to the FileMetaData object created during the file upload.

Parameters
key the key to use for the extra associated with the FileMetaData
value the value of the extra

public Object getExtra (String key)

Retrieve an extra property by key associated with this KinveyFile.

Parameters
key the key used to define the property
Returns
  • the value of the property, or null if it hasn't been set.

public HashMap<String, Object> getExtras ()

public String getFileName ()

public String getId ()

Get the id of a Linked File

Returns
  • the id

public ByteArrayInputStream getInput ()

public ByteArrayOutputStream getOutput ()

public boolean hasExtras ()

public boolean isResolve ()

public void setFileName (String fileName)

public void setId (String id)

public void setInput (ByteArrayInputStream input)

public void setOutput (ByteArrayOutputStream output)

public void setResolve (boolean resolve)