in src/main/java/com/pastdev/jsch/nio/file/UnixSshFileSystemProvider.java [662:683]
Map<UnixSshPath, PosixFileAttributes> statDirectory( UnixSshPath directoryPath ) throws IOException {
Map<UnixSshPath, PosixFileAttributes> map = new HashMap<>();
SupportedAttribute[] allAttributes = SupportedAttribute.values();
String command = directoryPath.getFileSystem().getCommand( "find" ) + " "
+ directoryPath.toAbsolutePath().quotedString()
+ " -maxdepth 1 -type f -exec " + statCommand( directoryPath, allAttributes, true ) + " {} +";
String stdout = executeForStdout( directoryPath, command );
if ( stdout.length() > 0 ) {
String[] results = stdout.split( "\n" );
for ( String file : results ) {
logger.trace( "parsing stat response for {}", file );
Map<String, Object> fileAttributes = statParse( file, allAttributes );
UnixSshPath filePath = directoryPath.toAbsolutePath().relativize( directoryPath.resolve(
(String)fileAttributes.get( SupportedAttribute.name.toString() ) ) );
map.put( filePath, new PosixFileAttributesImpl( fileAttributes ) );
}
}
logger.trace( "returning map" );
return map;
}