This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class NetworkOperations { | |
@Override | |
public Response<ResponseBody> directUpload(File file, String fileType, String validationKey) throws IOException { | |
Logger.debug(TAG, "Type of file: " + fileType); | |
Logger.info(TAG, "Uploading of file with name: " + file.getName()); | |
FileDataRequest wrappedFileData = WrapUtils.wrapUploadFileData(file); // any additional metadata | |
MultipartBody.Part rawFile = WrapUtils.wrapFile(file, fileType); // wrap raw file into multipart body | |
Call<UploadedFileResponse> uploadCall = mService.directUpload(wrappedFileData, rawFile, validationKey); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (BuildConfig.DEBUG) { | |
StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder() | |
.detectCustomSlowCalls() | |
.detectDiskReads() | |
.detectDiskWrites() | |
.detectNetwork() | |
.penaltyLog() | |
.build()); | |
StrictMode.VmPolicy.Builder vmPolicy = new StrictMode.VmPolicy.Builder() |