code: public static TarHeader createHeader(String entryName, long size, long modTime, boolean dir, int permissions) {
  		String name = entryName;
  		name = TarUtils.trim(name.replace(File.separatorChar, '/'), '/');
  
  		TarHeader header = new TarHeader();
  		header.linkName = new StringBuffer("");
  		header.mode = permissions;
  
  		if (name.length() > 100) {
  			header.namePrefix = new StringBuffer(name.substring(0, name.lastIndexOf('/')));
  			header.name = new StringBuffer(name.substring(name.lastIndexOf('/') + 1));
  		} else {
  			header.name = new StringBuffer(name);
  		}
  		if (dir) {
  			header.linkFlag = TarHeader.LF_DIR;
  			if (header.name.charAt(header.name.length() - 1) != '/') {
  				header.name.append("/");
  			}
  			header.size = 0;
  		} else {
  			header.linkFlag = TarHeader.LF_NORMAL;
  			header.size = size;
  		}
  
  		header.modTime = modTime;
  		header.checkSum = 0;
  		header.devMajor = 0;
  		header.devMinor = 0;
  
  		return header;
  	}
docs: Creates a new header for a file/directory entry.
  
  
  @param entryName
  File name
  @param size
  File size in bytes
  @param modTime
  Last modification time in numeric Unix time format
  @param dir
  Is directory