public class FileImpl extends BaseImpl<File,FileReader,FileWriter> implements FileReader, FileWriter
apiVersion, canvasBaseUrl, canvasMessenger, masqueradeAs, masqueradeType, oauthToken, paginationPageSize, responseCallback, responseParser, serializeNulls| Constructor and Description |
|---|
FileImpl(String canvasBaseUrl,
Integer apiVersion,
OauthToken oauthToken,
RestClient restClient,
int connectTimeout,
int readTimeout,
Integer paginationPageSize,
Boolean serializeNulls)
Construct a new CanvasApi class with an OAuth token
|
| Modifier and Type | Method and Description |
|---|---|
Optional<File> |
getFile(String url)
This is used primarily when you have a redirect after you've uploaded a file.
|
protected Type |
listType() |
protected Class<File> |
objectType() |
Optional<File> |
upload(Deposit deposit,
InputStream in,
String filename) |
buildCanvasUrl, encode, getFromCanvas, getListFromCanvas, parseListOfResponses, readAsCanvasUser, readAsSisUser, withCallback, writeAsCanvasUser, writeAsSisUserclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitreadAsCanvasUser, readAsSisUser, withCallbackwriteAsCanvasUser, writeAsSisUserpublic FileImpl(String canvasBaseUrl, Integer apiVersion, OauthToken oauthToken, RestClient restClient, int connectTimeout, int readTimeout, Integer paginationPageSize, Boolean serializeNulls)
canvasBaseUrl - The base URL of your canvas instanceapiVersion - The version of the Canvas API (currently 1)oauthToken - OAuth token to use when executing API callsrestClient - a RestClient implementation to use when talking to CanvasconnectTimeout - Timeout in seconds to use when connectingreadTimeout - Timeout in seconds to use when waiting for data to come back from an open connectionpaginationPageSize - How many objects to request per page on paginated requestsserializeNulls - Whether or not to include null fields in the serialized JSON. Defaults to false if nullpublic Optional<File> upload(Deposit deposit, InputStream in, String filename) throws IOException
upload in interface FileWriterIOExceptionpublic Optional<File> getFile(String url) throws IOException
FileReadergetFile in interface FileReaderurl - The URL of the file that has been uploaded.IOException - When there is an error communicating with Canvasprotected Type listType()
listType in class BaseImpl<File,FileReader,FileWriter>protected Class<File> objectType()
objectType in class BaseImpl<File,FileReader,FileWriter>Copyright © 2021 Kansas State University, Office of Mediated Education. All rights reserved.