@@ -0,0 +1,2699 @@
+/*%0D%0A * The MIT License (MIT)%0D%0A *%0D%0A * Copyright (c) 2015 paqueloz%0D%0A *%0D%0A * Permission is hereby granted, free of charge, to any person obtaining a copy%0D%0A * of this software and associated documentation files (the %22Software%22), to deal%0D%0A * in the Software without restriction, including without limitation the rights%0D%0A * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell%0D%0A * copies of the Software, and to permit persons to whom the Software is%0D%0A * furnished to do so, subject to the following conditions:%0D%0A *%0D%0A * The above copyright notice and this permission notice shall be included in all%0D%0A * copies or substantial portions of the Software.%0D%0A *%0D%0A * THE SOFTWARE IS PROVIDED %22AS IS%22, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR%0D%0A * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,%0D%0A * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE%0D%0A * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER%0D%0A * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,%0D%0A * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE%0D%0A * SOFTWARE.%0D%0A */%0D%0Apackage com.batmgr.filesystem;%0D%0A%0D%0Aimport static org.junit.Assert.assertTrue;%0D%0A%0D%0Aimport java.io.IOException;%0D%0Aimport java.net.URL;%0D%0Aimport java.nio.file.Files;%0D%0Aimport java.nio.file.Path;%0D%0Aimport java.nio.file.Paths;%0D%0Aimport java.security.NoSuchAlgorithmException;%0D%0A%0D%0Aimport org.apache.commons.io.FileUtils;%0D%0Aimport org.junit.Before;%0D%0Aimport org.junit.Test;%0D%0A%0D%0Apublic class DirCheckerTest %7B%0D%0A    %0D%0A    private URL  resource;%0D%0A%0D%0A    private Path testRoot;%0D%0A%0D%0A    @Before%0D%0A    public void setUp() throws Exception %7B%0D%0A        resource = getClass().getResource(%22/sample.txt%22);%0D%0A        testRoot = Paths.get(resource.toURI()).resolve(%22..%22).normalize();%0D%0A    %7D%0D%0A    %0D%0A    private void cleanupDir(Path p) throws IOException, InterruptedException%0D%0A    %7B%0D%0A        if (Files.exists(p)) %7B%0D%0A            FileUtils.deleteDirectory(p.toFile());%0D%0A        %7D%0D%0A        Thread.sleep(1000);%0D%0A        Files.createDirectory(p);%0D%0A    %7D%0D%0A    %0D%0A    @Test%0D%0A    public void test_indexFolder() throws IOException, InterruptedException, InvalidIndexException, NoSuchAlgorithmException %7B%0D%0A        String sampleFile = %22smpl.txt%22;%0D%0A        Path testPath = testRoot.resolve(%22tst1%22);%0D%0A        cleanupDir(testPath);%0D%0A        Files.copy(testRoot.resolve(%22sample.txt%22), testPath.resolve(sampleFile));%0D%0A        DirChecker dirChecker = new DirChecker();%0D%0A        dirChecker.indexFolder(testPath);%0D%0A        DirInfo dirInfo = new DirInfo(testPath);%0D%0A        assertTrue(dirInfo.isHashPresent(%224F13A4F6083341F66D39024D7B3765387EE1A3437414CECCC774238A62C65BBA%22));%0D%0A    %7D%0D%0A    %0D%0A%7D%0D%0A

add DirCheckerTest.java