Search in sources :

Example 11 with UsbFile

use of com.github.mjdev.libaums.fs.UsbFile 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;
}
Also used : UsbFile(com.github.mjdev.libaums.fs.UsbFile) MatrixCursor(dev.dworks.apps.anexplorer.cursor.MatrixCursor)

Example 12 with UsbFile

use of com.github.mjdev.libaums.fs.UsbFile in project samourai-wallet-android by Samourai-Wallet.

the class OpenDimeActivity method onBackPressed.

@Override
public void onBackPressed() {
    try {
        UsbFile dir = dirs.pop();
    } catch (NoSuchElementException e) {
        ;
    }
    AppUtil.getInstance(OpenDimeActivity.this).restartApp();
    super.onBackPressed();
}
Also used : UsbFile(com.github.mjdev.libaums.fs.UsbFile) NoSuchElementException(java.util.NoSuchElementException)

Example 13 with UsbFile

use of com.github.mjdev.libaums.fs.UsbFile in project samourai-wallet-android by Samourai-Wallet.

the class UsbFileWrapper method listFiles.

@Override
public UsbFile[] listFiles() throws IOException {
    if (dir == null) {
        throw new UnsupportedOperationException("This is a file!");
    }
    List<UsbFile> list = new ArrayList<>();
    Iterator<? extends FSEntry> iterator = dir.iterator();
    while (iterator.hasNext()) {
        FSEntry entry = iterator.next();
        list.add(new UsbFileWrapper(entry));
    }
    UsbFile[] array = new UsbFile[list.size()];
    array = list.toArray(array);
    return array;
}
Also used : FSEntry(org.jnode.fs.FSEntry) AbstractUsbFile(com.github.mjdev.libaums.fs.AbstractUsbFile) UsbFile(com.github.mjdev.libaums.fs.UsbFile) ArrayList(java.util.ArrayList)

Aggregations

UsbFile (com.github.mjdev.libaums.fs.UsbFile)13 FileNotFoundException (java.io.FileNotFoundException)6 IOException (java.io.IOException)6 MatrixCursor (dev.dworks.apps.anexplorer.cursor.MatrixCursor)3 UsbDevice (android.hardware.usb.UsbDevice)2 DocumentFile (android.support.provider.DocumentFile)2 FileSystem (com.github.mjdev.libaums.fs.FileSystem)2 UsbFileInputStream (com.github.mjdev.libaums.fs.UsbFileInputStream)2 UsbFileOutputStream (com.github.mjdev.libaums.fs.UsbFileOutputStream)2 PendingIntent (android.app.PendingIntent)1 Intent (android.content.Intent)1 UsbManager (android.hardware.usb.UsbManager)1 Handler (android.os.Handler)1 ArrayMap (android.support.v4.util.ArrayMap)1 Spannable (android.text.Spannable)1 SpannableString (android.text.SpannableString)1 ForegroundColorSpan (android.text.style.ForegroundColorSpan)1 AbstractUsbFile (com.github.mjdev.libaums.fs.AbstractUsbFile)1 InputStream (java.io.InputStream)1 OutputStream (java.io.OutputStream)1