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, update
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
create
public FilesApiPart(ParentApiPart parent)
public FilesApiPart(ParentApiPart parent, com.fasterxml.jackson.databind.ObjectMapper mapper)
public StoredFile createAndUpload(Path localPath) throws SlickError
FilesQueryApi
createAndUpload
in interface FilesQueryApi
localPath
- 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
FilesQueryApi
InputStream
.createAndUpload
in interface FilesQueryApi
filename
- 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
FilesApi
addChunk
in interface FilesApi
data
- The "chunk" of data to uploadSlickError
- if an error occurs talking to slick.Copyright © 2015. All rights reserved.