title: Mkdir doesn't work whilst trying to un-tar using JTar
body: <p>I am trying to implement a function that un-tars a file. Below is the code I have written using JTar</p>
  
  <pre><code>    private void untar(String tarFile, String destFolder) throws IOException {
              TarInputStream tis = new TarInputStream(new BufferedInputStream(new FileInputStream(tarFile)));
              TarEntry entry;
              while (( entry = tis.getNextEntry() ) != null) {
                  System.out.println( "Extracting: " + entry.getName() );
                  int count;
                  byte data[] = new byte[2048];
  
                  if (entry.isDirectory()) {
                      new File( destFolder + "/" + entry.getName() ).mkdirs();
                      continue;
                  } else {
                      int di = entry.getName().lastIndexOf( '/' );
                      System.out.println("File"+di);
                      if (di != -1) {
                          File f = new File( destFolder + "/" + entry.getName().substring( 0, di ) );
                          if(f.mkdirs())
                              System.out.println(f.isDirectory());
                      }
                  }
  
                  FileOutputStream fos = new FileOutputStream( destFolder + "/" + entry.getName() );
                  BufferedOutputStream dest = new BufferedOutputStream( fos );
  
                  while (( count = tis.read( data ) ) != -1) {
                      dest.write( data, 0, count );
                  }
  
                  dest.flush();
                  dest.close();
              }
              tis.close();
          }
  </code></pre>
  
  <p>When I hit the mkdirs() part and try to create a directory it does not do so, and I cannot see any output on console after the <code>if</code> statement. </p>
  
  <p>Possibly this is the reason that the subsequent code for FileOutputStream shows an IOexception stating not a directory.</p>
  
  <p>I can't find a solution for this problem anywhere.</p>