@Override public List<ResourceInfo> list( String basePath, ResourcePattern resourcePattern, Counter counter) throws IOException, InterruptedException { return core.list(basePath, resourcePattern, counter); }
@Override public List<ResourceInfo> list( String basePath, ResourcePattern resourcePattern, Counter counter) throws IOException, InterruptedException { heartbeat.register(counter); try { return entity.list(basePath, resourcePattern, counter); } finally { heartbeat.unregister(counter); } }
DirectDataSource source = repository.getRelatedDataSource(path); for (FilePattern pattern : patterns) { List<ResourceInfo> list = source.list(basePath, pattern, new Counter()); for (ResourceInfo info : list) { System.out.println(info.getPath());
static List<ResourceInfo> list(DirectIoPath path) { LOG.debug("listing: {} ({})", path, path.getBarePath()); try { if (path.isComponentRoot()) { return Collections.singletonList(new ResourceInfo( path.getSource().getId(), path.getSource().getEntity().path(path.getComponentPath().getPathString()), true)); } else if (path.getResourcePattern().isPresent()) { return path.getSource().getEntity().list( path.getComponentPath().getPathString(), path.getResourcePattern().get(), new Counter()); } else { return path.getSource().getEntity().list( BasePath.EMPTY.getPathString(), path.getComponentPath().asFilePattern(), new Counter()); } } catch (IOException | InterruptedException e) { throw new CommandExecutionException(MessageFormat.format( "error occurred while resolving path: {0} ({1})", path, path.getBarePath()), e); } } }