use of dev.dworks.apps.anexplorer.cursor.MatrixCursor in project AnExplorer by 1hakr.
the class UsbStorageProvider method querySearchDocuments.
@Override
public Cursor querySearchDocuments(String rootId, String query, String[] projection) throws FileNotFoundException {
UsbPartition usbPartition = mRoots.get(rootId);
final UsbFile parent = usbPartition.fileSystem.getRootDirectory();
updateSettings();
final MatrixCursor result = new MatrixCursor(resolveDocumentProjection(projection));
// TODO implement actual search
return result;
}
use of dev.dworks.apps.anexplorer.cursor.MatrixCursor in project AnExplorer by 1hakr.
the class DocumentArchive method queryChildDocuments.
/**
* Lists child documents of an archive or a directory within an
* archive. Must be called only for archives with supported mime type,
* or for documents within archives.
*/
public Cursor queryChildDocuments(String documentId, @Nullable String[] projection, @Nullable String sortOrder) throws FileNotFoundException {
final ParsedDocumentId parsedParentId = ParsedDocumentId.fromDocumentId(documentId, mIdDelimiter);
Preconditions.checkArgumentEquals(mDocumentId, parsedParentId.mArchiveId, "Mismatching document ID. Expected: %s, actual: %s.");
final String parentPath = parsedParentId.mPath != null ? parsedParentId.mPath : "/";
final MatrixCursor result = new MatrixCursor(projection != null ? projection : DEFAULT_PROJECTION);
if (mNotificationUri != null) {
result.setNotificationUri(mContext.getContentResolver(), mNotificationUri);
}
final List<ZipEntry> parentList = mTree.get(parentPath);
if (parentList == null) {
throw new FileNotFoundException();
}
for (final ZipEntry entry : parentList) {
addCursorRow(result, entry);
}
return result;
}
Aggregations