// Path: giraffa-core/src/test/java/org/apache/giraffa/GiraffaTestUtils.java
// public static void printFileStatus(FileStatus fileStat) throws IOException {
//   printFileStatus(fileStat, -1);
// }


import java.io.IOException;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.hadoop.fs.FileAlreadyExistsException;
import org.apache.hadoop.fs.FileStatus;
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.fs.PathIsNotEmptyDirectoryException;
import org.apache.hadoop.fs.permission.FsPermission;
import org.apache.hadoop.hbase.HBaseTestingUtility;
import org.apache.hadoop.io.IOUtils;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import static org.apache.giraffa.GiraffaTestUtils.printFileStatus;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
    grfs.mkdirs(new Path("folder1/folder3"));
    grfs.create(new Path("folder1/folder3/test.txt"));
    FileStatus[] files = grfs.listStatus(new Path("."));
    assertEquals(2, files.length);
    grfs.delete(new Path("folder1"), true);
    files = grfs.listStatus(new Path("."));
    printFileStatus(files);
    assertEquals(1, files.length);
  }

  @Test
  public void testDeleteMkdirsSamePath() throws IOException {
    Path path = new Path("/test");
    grfs.mkdirs(path);
    grfs.delete(path, false);
    grfs.mkdirs(path);
    assertTrue(grfs.exists(path));
  }

  @Test
  public void testDirAttributes() throws IOException {
    grfs.mkdirs(new Path("folder2"));

    LOG.debug("SETTING PERMISSION OF \"folder2\" TO 755");
    grfs.setPermission(new Path("folder2"), new FsPermission((short) 0755));

    LOG.debug("SETTING TIMES OF \"folder2\" TO M:25, A:30");
    grfs.setTimes(new Path("folder2"), 25, 30);

    FileStatus[] files = grfs.listStatus(new Path("."));
// Path: giraffa-core/src/test/java/org/apache/giraffa/GiraffaTestUtils.java
// public static void printFileStatus(FileStatus fileStat) throws IOException {
//   printFileStatus(fileStat, -1);
// }


// Path: giraffa-core/src/test/java/org/apache/giraffa/TestGiraffaFS.java
import java.io.IOException;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.hadoop.fs.FileAlreadyExistsException;
import org.apache.hadoop.fs.FileStatus;
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.fs.PathIsNotEmptyDirectoryException;
import org.apache.hadoop.fs.permission.FsPermission;
import org.apache.hadoop.hbase.HBaseTestingUtility;
import org.apache.hadoop.io.IOUtils;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import static org.apache.giraffa.GiraffaTestUtils.printFileStatus;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;

    grfs.mkdirs(new Path("folder1/folder3"));
    grfs.create(new Path("folder1/folder3/test.txt"));
    FileStatus[] files = grfs.listStatus(new Path("."));
    assertEquals(2, files.length);
    grfs.delete(new Path("folder1"), true);
    files = grfs.listStatus(new Path("."));
    printFileStatus(files);
    assertEquals(1, files.length);
  }

  @Test
  public void testDeleteMkdirsSamePath() throws IOException {
    Path path = new Path("/test");
    grfs.mkdirs(path);
    grfs.delete(path, false);
    grfs.mkdirs(path);
    assertTrue(grfs.exists(path));
  }

  @Test
  public void testDirAttributes() throws IOException {
    grfs.mkdirs(new Path("folder2"));

    LOG.debug("SETTING PERMISSION OF \"folder2\" TO 755");
    grfs.setPermission(new Path("folder2"), new FsPermission((short) 0755));

    LOG.debug("SETTING TIMES OF \"folder2\" TO M:25, A:30");
    grfs.setTimes(new Path("folder2"), 25, 30);

    FileStatus[] files = grfs.listStatus(new Path("."));
    printFileStatus(files);