public static File getBaseDir ( final List < File > files ) { String common = getCommonPrefix ( files . stream ( ) . map ( new Function < File , String > ( ) { @ Override public String apply ( final File file ) { return file . getAbsolutePath ( ) ; } } ) . collect ( Collectors . toList ( ) ) ) ; if ( null != common ) { return new File ( common ) ; } return null ; }
Return common base directory of the given files