com.strongloop.android.loopback

## Class FileRepository

- java.lang.Object
- - com.strongloop.android.remoting.Repository<T>
  - - com.strongloop.android.loopback.RestRepository<File>
    - - com.strongloop.android.loopback.FileRepository

    public class FileRepository
    extends RestRepository<File>

### Constructor Summary

Constructors
Constructor and Description
`FileRepository()`

### Method Summary

Methods
`RestContract` `createContract()` Creates a `RestContract` representing the user type's custom routes.
`File` `createObject(java.util.Map<java.lang.String,? extends java.lang.Object> parameters)` Creates a new `VirtualObject` as a virtual instance of this remote class.
`void` `get(java.lang.String name, ObjectCallback<File> callback)` Get file by name
`void` `getAll(ListCallback<File> callback)` List all files in the container.
`Container` `getContainer()`
`java.lang.String` `getContainerName()`
`void` `setContainer(Container value)`
`void` `upload(java.io.File localFile, ObjectCallback<File> callback)` Upload a new file
`void` `upload(java.lang.String name, byte[] content, java.lang.String contentType, ObjectCallback<File> callback)` Upload a new file
`void` `upload(java.lang.String name, java.io.InputStream content, java.lang.String contentType, ObjectCallback<File> callback)` Upload a new file

### Methods inherited from class com.strongloop.android.loopback.RestRepository

`getApplicationContext, getRestAdapter`

### Methods inherited from class com.strongloop.android.remoting.Repository

`getAdapter, getClassName, invokeStaticMethod, invokeStaticMethod, setAdapter`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### FileRepository

    public FileRepository()

### Method Detail

#### getContainer

    public Container getContainer()

#### getContainerName

    public java.lang.String getContainerName()

#### setContainer

    public void setContainer(Container value)

#### createContract

    public RestContract createContract()

Creates a `RestContract` representing the user type's custom routes. Used to extend an `Adapter` to support user. Calls super `ModelRepository` createContract first.

Overrides:
  `createContract` in class `RestRepository<File>`
Returns:
  A `RestContract` for this model type.

#### createObject

    public File createObject(java.util.Map<java.lang.String,? extends java.lang.Object> parameters)

Description copied from class: `Repository`
Creates a new `VirtualObject` as a virtual instance of this remote class.

Overrides:
  `createObject` in class `Repository<File>`
Parameters:
  `parameters` - The creation parameters of the new object.
Returns:
  A new `VirtualObject` based on this prototype.

#### upload

    public void upload(java.lang.String name,
              byte[] content,
              java.lang.String contentType,
              ObjectCallback<File> callback)

Upload a new file

Parameters:
  `name` - The file name, must be unique within the container.
  `content` - Content of the file.
  `contentType` - Content type (optional).
  `callback` - The callback to be executed when finished.

#### upload

    public void upload(java.lang.String name,
              java.io.InputStream content,
              java.lang.String contentType,
              ObjectCallback<File> callback)

Upload a new file

Parameters:
  `name` - The file name, must be unique within the container.
  `content` - Content of the file.
  `contentType` - Content type (optional).
  `callback` - The callback to be executed when finished.

#### upload

    public void upload(java.io.File localFile,
              ObjectCallback<File> callback)

Upload a new file

Parameters:
  `localFile` - The local file to upload.
  `callback` - The callback to be executed when finished.

#### get

    public void get(java.lang.String name,
           ObjectCallback<File> callback)

Get file by name

Parameters:
  `name` - The name of the file to get.
  `callback` - The callback to be executed when finished.

#### getAll

    public void getAll(ListCallback<File> callback)

List all files in the container.

Parameters:
  `callback` - The callback to be executed when finished.