@Override
    public AttributedList<Path> list(final Path directory, final ListProgressListener listener) throws BackgroundException {
        try {
            final AttributedList<Path> children = new AttributedList<Path>();
            final IRODSFileSystemAO fs = session.getClient();
            final IRODSFile f = fs.getIRODSFileFactory().instanceIRODSFile(directory.getAbsolute());
            if(!f.exists()) {
                throw new NotfoundException(directory.getAbsolute());
            }
            for(File file : fs.getListInDirWithFileFilter(f, TrueFileFilter.TRUE)) {
                final String normalized = PathNormalizer.normalize(file.getAbsolutePath(), true);
                if(StringUtils.equals(normalized, directory.getAbsolute())) {
                    continue;
                }
                final PathAttributes attributes = new PathAttributes();
                final ObjStat stats = fs.getObjStat(file.getAbsolutePath());
                attributes.setModificationDate(stats.getModifiedAt().getTime());
                attributes.setCreationDate(stats.getCreatedAt().getTime());
                attributes.setSize(stats.getObjSize());
                attributes.setChecksum(Checksum.parse(Hex.encodeHexString(Base64.decodeBase64(stats.getChecksum()))));
                attributes.setOwner(stats.getOwnerName());
                attributes.setGroup(stats.getOwnerZone());
                children.add(new Path(directory, PathNormalizer.name(normalized),
                        file.isDirectory() ? EnumSet.of(Path.Type.directory) : EnumSet.of(Path.Type.file),
                        attributes));
                listener.chunk(directory, children);
            }
            return children;
        }
        catch(JargonException e) {
            throw new IRODSExceptionMappingService().map("Listing directory {0} failed", e, directory);
        }
    }
@Test
    @Ignore
    public void testList() throws Exception {
        final ProtocolFactory factory = new ProtocolFactory(new HashSet<>(Collections.singleton(new IRODSProtocol())));
        final Profile profile = new ProfilePlistReader(factory).read(
                this.getClass().getResourceAsStream("/iRODS (iPlant Collaborative).cyberduckprofile"));
        final Host host = new Host(profile, profile.getDefaultHostname(), new Credentials(
                PROPERTIES.get("irods.key"), PROPERTIES.get("irods.secret")
        ));

        final IRODSSession session = new IRODSSession(host);

        assertNotNull(session.open(new DisabledProxyFinder(), new DisabledHostKeyCallback(), new DisabledLoginCallback(), new DisabledCancelCallback()));
        assertTrue(session.isConnected());
        assertNotNull(session.getClient());
        session.login(new DisabledLoginCallback(), new DisabledCancelCallback());
        final AttributedList<Path> list = new IRODSListService(session).list(new IRODSHomeFinderService(session).find(), new DisabledListProgressListener());
        assertFalse(list.isEmpty());
        for(Path p : list) {
            assertEquals(new IRODSHomeFinderService(session).find(), p.getParent());
            assertNotEquals(-1L, p.attributes().getModificationDate());
            assertNotEquals(-1L, p.attributes().getSize());
        }
        session.close();
    }