public class FilesApiPart extends ApiPart<StoredFile> implements FilesQueryApi, FilesApi
| Constructor and Description |
|---|
FilesApiPart(ParentApiPart parent) |
FilesApiPart(ParentApiPart parent,
com.fasterxml.jackson.databind.ObjectMapper mapper) |
| Modifier and Type | Method and Description |
|---|---|
StoredFile |
addChunk(byte[] data)
Add a "chunk" of data to a stored file.
|
StoredFile |
createAndUpload(Path localPath)
Create a new StoredFile in slick, and upload the content from a local file path.
|
StoredFile |
createAndUpload(String filename,
String mimetype,
InputStream stream)
Create a new StoredFile in slick, and upload the content from an
InputStream. |
create, delete, findOrCreate, get, getList, getParent, getSlickClient, getWebTarget, getWebTargetForRequest, makeRequest, updateclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcreatepublic FilesApiPart(ParentApiPart parent)
public FilesApiPart(ParentApiPart parent, com.fasterxml.jackson.databind.ObjectMapper mapper)
public StoredFile createAndUpload(Path localPath) throws SlickError
FilesQueryApicreateAndUpload in interface FilesQueryApilocalPath - The local path to open the file and upload it.SlickError - if an IO Exception occurs or there is a problem talking with slick.public StoredFile createAndUpload(String filename, String mimetype, InputStream stream) throws SlickError
FilesQueryApiInputStream.createAndUpload in interface FilesQueryApifilename - The name of the file (used in creating the StoredFile).mimetype - The mime type of the file.stream - The input stream to read from.StoredFile saved by slick.SlickError - if an error reading the steam occurs, or if any error occurs while creating the object or uploading the content.public StoredFile addChunk(byte[] data) throws SlickError
FilesApiaddChunk in interface FilesApidata - The "chunk" of data to uploadSlickError - if an error occurs talking to slick.Copyright © 2015. All rights reserved.