private void genFileStructure ( ) { List < INode > leaves = getLeaves ( ) ; int totalLeaves = leaves . size ( ) ; for ( int i = 0 ; i < numOfFiles ; i ++ ) { int leaveNum = r . nextInt ( totalLeaves ) ; double fileSize ; do { fileSize = r . nextGaussian ( ) + avgFileSize ; } while ( fileSize < 0 ) ; leaves . get ( leaveNum ) . addChild ( new FileINode ( FILE_NAME_PREFIX + i , fileSize ) ) ; } }
Decides where to place all the files and its length . It first collects all empty directories in the tree . For each file it randomly chooses an empty directory to place the file . The file s length is generated using Gaussian distribution .