@@ -0,0 +1,1942 @@
+package org.apache.hadoop.TD;%0A%0Aimport java.io.File;%0Aimport java.io.IOException;%0Aimport java.io.RandomAccessFile;%0Aimport java.security.SecureRandom;%0Aimport java.util.Random;%0A%0Aimport javax.swing.Spring;%0A%0Aimport org.apache.hadoop.fs.Path;%0A%0Apublic class SecureDelRandom %7B%0A%09%0A%09 /**%0A     * Returns a pseudo-random number between min and max, inclusive.%0A     * The difference between min and max can be at most%0A     * %3Ccode%3EInteger.MAX_VALUE - 1%3C/code%3E.%0A     *%0A     * @param min Minimum value%0A     * @param max Maximum value.  Must be greater than min.%0A     * @return Integer between min and max, inclusive.%0A     * @see java.util.Random#nextInt(int)%0A     */%0A    public static int randInt(int min, int max) %7B%0A        Random rand = new Random();%0A%0A        // nextInt is normally exclusive of the top value,%0A        // so add 1 to make it inclusive%0A        int randomNum = rand.nextInt((max - min) + 1) + min;%0A%0A        return randomNum;%0A    %7D%0A%0A%09%0A%09public static void secureDelete(File file) throws IOException %7B%0A%09%09if (file.exists()) %7B%0A%09%09%09long length = file.length();%0A%09%09%09System.out.println(%22Length :%22 + length );%0A%09%09%09SecureRandom random = new SecureRandom();%0A%09%09%09%0A%09%09%09RandomAccessFile raf = new RandomAccessFile(file, %22rws%22);%0A%09%09%09raf.seek(0);%0A%09%09%09raf.getFilePointer();%0A%09%09%09byte%5B%5D data = new byte%5B64%5D;%0A%09%09%09int pos = 0;%0A%09%09%09Random rand = new Random(); %0A%09%09%09String content =%22%22;%0A%09%09%09for(int i=0; i%3Clength; i++)%0A            %7B%0A            %09int randomNum = rand.nextInt((1 - 0) + 1) + 0;%0A            %09content = content + randomNum;            %09%0A            %7D%0A%09%09%09raf.writeUTF(content);%0A%09%09%09raf.close();%0A%09%09%09//file.delete();%0A%09%09%7D%0A%09%7D%0A%09%0A%09public static void main(String%5B%5D args) throws IOException %7B%0A%09%09String file = %22/Users/bikash/hadoop/datanode/current/BP-1467327831-192.168.254.33-1446106217900/current/finalized/subdir0/subdir0/blk_1073741953%22;%0A%09%09//Path path = new Path(file);%0A%09%09File f = new File(file);%0A        //SecureDelete.delete(file,7, conf);%0A%09%09secureDelete(f);%0A%09 %7D%0A%09%0A%09%0A%7D%0A

secure deletion algorithm added