use of com.instructure.canvasapi2.models.FileFolder in project instructure-android by instructure.
the class FileFolderManager method deleteFile.
public static void deleteFile(long fileId, StatusCallback<FileFolder> callback) {
if (isTesting() || mTesting) {
// TODO
} else {
RestBuilder adapter = new RestBuilder(callback);
RestParams params = new RestParams.Builder().build();
FileFolderAPI.deleteFile(adapter, fileId, callback, params);
}
}
use of com.instructure.canvasapi2.models.FileFolder in project instructure-android by instructure.
the class FileFolderManager method getFirstPageFilesRoot.
public static void getFirstPageFilesRoot(CanvasContext canvasContext, boolean forceNetwork, final StatusCallback<List<FileFolder>> callback) {
if (isTesting() || mTesting) {
// TODO
} else {
final RestBuilder adapter = new RestBuilder(callback);
RestParams params = new RestParams.Builder().withCanvasContext(canvasContext).withForceReadFromNetwork(forceNetwork).withPerPageQueryParam(true).build();
final RestParams fileParams = new RestParams.Builder().withForceReadFromNetwork(forceNetwork).build();
FileFolderAPI.getRootFolderForContext(adapter, canvasContext, new StatusCallback<FileFolder>() {
@Override
public void onResponse(@NonNull Response<FileFolder> response, @NonNull LinkHeaders linkHeaders, @NonNull ApiType type) {
FileFolderAPI.getFirstPageFiles(adapter, response.body().getId(), callback, fileParams);
}
}, params);
}
}
use of com.instructure.canvasapi2.models.FileFolder in project instructure-android by instructure.
the class FileFolderManager method getFileFolderFromURLSynchronous.
public static FileFolder getFileFolderFromURLSynchronous(String url) {
if (isTesting() || mTesting) {
// TODO:
} else {
RestBuilder adapter = new RestBuilder(new StatusCallback() {
});
RestParams params = new RestParams.Builder().withPerPageQueryParam(false).build();
return FileFolderAPI.getFileFolderFromURLSynchronous(adapter, url, params);
}
return null;
}
use of com.instructure.canvasapi2.models.FileFolder in project instructure-android by instructure.
the class FileFolderManager method getAllFoldersRoot.
public static void getAllFoldersRoot(CanvasContext canvasContext, final boolean forceNetwork, final StatusCallback<List<FileFolder>> callback) {
if (isTesting() || mTesting) {
// TODO
} else {
final RestBuilder adapter = new RestBuilder(callback);
final RestParams params = new RestParams.Builder().withCanvasContext(canvasContext).withForceReadFromNetwork(forceNetwork).withPerPageQueryParam(true).build();
FileFolderAPI.getRootFolderForContext(adapter, canvasContext, new StatusCallback<FileFolder>() {
@Override
public void onResponse(@NonNull Response<FileFolder> response, @NonNull LinkHeaders linkHeaders, @NonNull ApiType type) {
getAllFolders(response.body().getId(), forceNetwork, callback);
}
}, params);
}
}
use of com.instructure.canvasapi2.models.FileFolder in project instructure-android by instructure.
the class FileFolderManager method deleteFolder.
public static void deleteFolder(long folderId, final StatusCallback<FileFolder> callback) {
if (isTesting() || mTesting) {
// TODO
} else {
final RestBuilder adapter = new RestBuilder(callback);
final RestParams params = new RestParams.Builder().build();
FileFolderAPI.deleteFolder(folderId, adapter, callback, params);
}
}
Aggregations