public class FileRepository extends RestRepository<File>
| Constructor and Description |
|---|
FileRepository() |
| Modifier and Type | Method and Description |
|---|---|
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
|
getApplicationContext, getRestAdaptergetAdapter, getClassName, invokeStaticMethod, invokeStaticMethod, setAdapterpublic Container getContainer()
public java.lang.String getContainerName()
public void setContainer(Container value)
public RestContract createContract()
RestContract representing the user type's custom
routes. Used to extend an Adapter to support user. Calls
super ModelRepository createContract first.createContract in class RestRepository<File>RestContract for this model type.public File createObject(java.util.Map<java.lang.String,? extends java.lang.Object> parameters)
RepositoryVirtualObject as a virtual instance of this remote
class.createObject in class Repository<File>parameters - The creation parameters of the new object.VirtualObject based on this prototype.public void upload(java.lang.String name,
byte[] content,
java.lang.String contentType,
ObjectCallback<File> callback)
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.public void upload(java.lang.String name,
java.io.InputStream content,
java.lang.String contentType,
ObjectCallback<File> callback)
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.public void upload(java.io.File localFile,
ObjectCallback<File> callback)
localFile - The local file to upload.callback - The callback to be executed when finished.public void get(java.lang.String name,
ObjectCallback<File> callback)
name - The name of the file to get.callback - The callback to be executed when finished.public void getAll(ListCallback<File> callback)
callback - The callback to be executed when finished.