// Path: src/jext2/exceptions/FileNameTooLong.java
// public class FileNameTooLong extends JExt2Exception {
// 	static final long serialVersionUID = 42;
// 	protected final static int ERRNO = Errno.ENAMETOOLONG;
// 
// 	public int getErrno() {
// 		return ERRNO;
// 	}
// }
// 
// Path: src/jext2/exceptions/IoError.java
// public class IoError extends JExt2Exception {
// 	static final long serialVersionUID = 42;
// 	protected static final int ERRNO=Errno.EIO;
// 	public IoError(String msg) {
// 		super(msg);
// 	}
// 	public IoError() {
// 		super();
// 	}
// 	public int getErrno() {
// 		return ERRNO;
// 	}
// }


import java.nio.ByteBuffer;
import jext2.exceptions.FileNameTooLong;
import jext2.exceptions.IoError;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;
	}

	public boolean isSymlink() {
		return getFileType() == FILETYPE_SYMLINK;
	}

	@Override
	protected void read(ByteBuffer buf) throws IoError {
		this.ino = Ext2fsDataTypes.getLE32U(buf, offset);
		this.recLen = Ext2fsDataTypes.getLE16U(buf, 4 + offset);
		this.nameLen = Ext2fsDataTypes.getLE8U(buf, 6 + offset);
		this.fileType = Ext2fsDataTypes.getLE8U(buf, 7 + offset);
		this.name = Ext2fsDataTypes.getString(buf, 8 + offset, this.nameLen);
	}

	@Override
	public String toString() {
		return ToStringBuilder.reflectionToString(this,
				ToStringStyle.MULTI_LINE_STYLE);
	}

	/**
	 * Create a new directory entry. Note that the name is mandatory because
	 * it dictates the record length on disk
	 */
	// TODO make visibility package
	public static DirectoryEntry create(String name) throws FileNameTooLong {
		int nameLen = Ext2fsDataTypes.getStringByteLength(name);

		if (nameLen > MAX_NAME_LEN) {
// Path: src/jext2/exceptions/FileNameTooLong.java
// public class FileNameTooLong extends JExt2Exception {
// 	static final long serialVersionUID = 42;
// 	protected final static int ERRNO = Errno.ENAMETOOLONG;
// 
// 	public int getErrno() {
// 		return ERRNO;
// 	}
// }
// 
// Path: src/jext2/exceptions/IoError.java
// public class IoError extends JExt2Exception {
// 	static final long serialVersionUID = 42;
// 	protected static final int ERRNO=Errno.EIO;
// 	public IoError(String msg) {
// 		super(msg);
// 	}
// 	public IoError() {
// 		super();
// 	}
// 	public int getErrno() {
// 		return ERRNO;
// 	}
// }


// Path: src/jext2/DirectoryEntry.java
import java.nio.ByteBuffer;
import jext2.exceptions.FileNameTooLong;
import jext2.exceptions.IoError;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;

	}

	public boolean isSymlink() {
		return getFileType() == FILETYPE_SYMLINK;
	}

	@Override
	protected void read(ByteBuffer buf) throws IoError {
		this.ino = Ext2fsDataTypes.getLE32U(buf, offset);
		this.recLen = Ext2fsDataTypes.getLE16U(buf, 4 + offset);
		this.nameLen = Ext2fsDataTypes.getLE8U(buf, 6 + offset);
		this.fileType = Ext2fsDataTypes.getLE8U(buf, 7 + offset);
		this.name = Ext2fsDataTypes.getString(buf, 8 + offset, this.nameLen);
	}

	@Override
	public String toString() {
		return ToStringBuilder.reflectionToString(this,
				ToStringStyle.MULTI_LINE_STYLE);
	}

	/**
	 * Create a new directory entry. Note that the name is mandatory because
	 * it dictates the record length on disk
	 */
	// TODO make visibility package
	public static DirectoryEntry create(String name) throws FileNameTooLong {
		int nameLen = Ext2fsDataTypes.getStringByteLength(name);

		if (nameLen > MAX_NAME_LEN) {
			throw new FileNameTooLong();