question: @ NotNull public static List < String > completeAbsolutePath ( @ NotNull String prefix , Predicate < File > accept ) { String nativePath = prefix . startsWith ( "/" ) && SystemInfoRt . isWindows ? OSUtil . bashCompatibleToNative ( prefix ) : prefix ; File base = new File ( nativePath ) ; boolean dotSuffix = prefix . endsWith ( "." ) && ! prefix . startsWith ( "." ) ; if ( ! base . exists ( ) || dotSuffix ) { base = base . getParentFile ( ) ; if ( base == null || ! base . exists ( ) ) { return Collections . emptyList ( ) ; } } File basePath ; String matchPrefix ; if ( base . isDirectory ( ) ) { basePath = base ; matchPrefix = "" ; } else { basePath = base . getParentFile ( ) ; matchPrefix = base . getName ( ) ; } List < String > result = Lists . newLinkedList ( ) ; for ( File fileCandidate : collectFiles ( basePath , matchPrefix ) ) { if ( ! accept . apply ( fileCandidate ) ) { continue ; } String resultPath ; if ( fileCandidate . isDirectory ( ) ) { resultPath = fileCandidate . getAbsolutePath ( ) + File . separator ; } else { resultPath = fileCandidate . getAbsolutePath ( ) ; } result . add ( OSUtil . toBashCompatible ( resultPath ) ) ; } return result ; }
target:  Provide a list of absolute paths on the current system which match the given prefix. Prefix is path whose last entry may be a partial match. A match with "/etc/def" matches all files and directories in /etc which start with "def".