Search in sources :

Example 1 with FSEntry

use of org.jnode.fs.FSEntry in project samourai-wallet-android by Samourai-Wallet.

the class UsbFileWrapper method list.

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

Example 2 with FSEntry

use of org.jnode.fs.FSEntry 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

ArrayList (java.util.ArrayList)2 FSEntry (org.jnode.fs.FSEntry)2 AbstractUsbFile (com.github.mjdev.libaums.fs.AbstractUsbFile)1 UsbFile (com.github.mjdev.libaums.fs.UsbFile)1