public static void createAllSymlink ( Configuration conf , File jobCacheDir , File workDir ) throws IOException { if ( ( jobCacheDir == null || ! jobCacheDir . isDirectory ( ) ) || workDir == null || ( ! workDir . isDirectory ( ) ) ) { return ; } boolean createSymlink = getSymlink ( conf ) ; if ( createSymlink ) { File [ ] list = jobCacheDir . listFiles ( ) ; for ( int i = 0 ; i < list . length ; i ++ ) { FileUtil . symLink ( list [ i ] . getAbsolutePath ( ) , new File ( workDir , list [ i ] . getName ( ) ) . toString ( ) ) ; } } }
This method create symlinks for all files in a given dir in another directory