use of com.instructure.canvasapi2.models.FileFolder in project instructure-android by instructure.
the class FileFolderManager method getAllFiles.
public static void getAllFiles(long folderId, boolean forceNetwork, StatusCallback<List<FileFolder>> callback) {
if (isTesting() || mTesting) {
// TODO
} else {
final RestBuilder adapter = new RestBuilder(callback);
final RestParams params = new RestParams.Builder().withForceReadFromNetwork(forceNetwork).withPerPageQueryParam(true).build();
final StatusCallback<List<FileFolder>> depaginatedCallback = new ExhaustiveListCallback<FileFolder>(callback) {
@Override
public void getNextPage(@NonNull StatusCallback<List<FileFolder>> callback, @NonNull String nextUrl, boolean isCached) {
FileFolderAPI.getNextPageFilesFolder(adapter, nextUrl, callback, params);
}
};
FileFolderAPI.getFirstPageFiles(adapter, folderId, depaginatedCallback, params);
}
}
use of com.instructure.canvasapi2.models.FileFolder in project instructure-android by instructure.
the class FileFolderManager method updateFolder.
public static void updateFolder(long folderId, UpdateFileFolder updateFileFolder, final StatusCallback<FileFolder> callback) {
if (isTesting() || mTesting) {
// TODO
} else {
final RestBuilder adapter = new RestBuilder(callback);
final RestParams params = new RestParams.Builder().build();
FileFolderAPI.updateFolder(folderId, updateFileFolder, adapter, callback, params);
}
}
use of com.instructure.canvasapi2.models.FileFolder in project instructure-android by instructure.
the class FileFolderManager method getNextPageFilesFolder.
public static void getNextPageFilesFolder(String url, boolean forceNetwork, StatusCallback<List<FileFolder>> callback) {
if (isTesting() || mTesting) {
// TODO
} else {
RestBuilder adapter = new RestBuilder(callback);
RestParams params = new RestParams.Builder().withForceReadFromNetwork(forceNetwork).withPerPageQueryParam(false).build();
FileFolderAPI.getNextPageFilesFolder(adapter, url, callback, params);
}
}
use of com.instructure.canvasapi2.models.FileFolder in project instructure-android by instructure.
the class FileFolderManager method getAllFolders.
public static void getAllFolders(long folderId, boolean forceNetwork, StatusCallback<List<FileFolder>> callback) {
if (isTesting() || mTesting) {
// TODO
} else {
final RestBuilder adapter = new RestBuilder(callback);
final RestParams params = new RestParams.Builder().withForceReadFromNetwork(forceNetwork).withPerPageQueryParam(true).build();
final StatusCallback<List<FileFolder>> depaginatedCallback = new ExhaustiveListCallback<FileFolder>(callback) {
@Override
public void getNextPage(@NonNull StatusCallback<List<FileFolder>> callback, @NonNull String nextUrl, boolean isCached) {
FileFolderAPI.getNextPageFilesFolder(adapter, nextUrl, callback, params);
}
};
FileFolderAPI.getFirstPageFolders(adapter, folderId, depaginatedCallback, params);
}
}
use of com.instructure.canvasapi2.models.FileFolder in project instructure-android by instructure.
the class FileFolderManager method createFolder.
public static void createFolder(long folderId, @NotNull CreateFolder folder, final StatusCallback<FileFolder> callback) {
if (isTesting() || mTesting) {
// TODO
} else {
final RestBuilder adapter = new RestBuilder(callback);
final RestParams params = new RestParams.Builder().build();
FileFolderAPI.createFolder(folderId, folder, adapter, callback, params);
}
}
Aggregations