GIT uses a subset of the available UNIX file permission bits. The
FileMode class provides access to constants defining the modes
actually used by GIT.
| Modifier and Type | Field and Description |
|---|---|
| public static final FileMode | EXECUTABLE_FILE
Mode indicating an entry is an executable file. |
| public static final FileMode | GITLINK
Mode indicating an entry is a submodule commit in another repository. |
| public static final FileMode | MISSING
Mode indicating an entry is missing during parallel walks. |
| private final int | |
| private final int | |
| private final byte[] | |
| public static final FileMode | REGULAR_FILE
Mode indicating an entry is a non-executable file. |
| public static final FileMode | SYMLINK
Mode indicating an entry is a symbolic link. |
| public static final FileMode | TREE
Mode indicating an entry is a tree (aka directory). |
| public static final int | TYPE_FILE
Bit pattern for |
| public static final int | |
| public static final int | TYPE_MASK
Mask to apply to a file mode to obtain its type bits. |
| public static final int | |
| public static final int | |
| public static final int |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public void | copyTo(OutputStream
stream to copy the mode to. os)Copy this mode as a sequence of octal US-ASCII bytes. |
| public void | copyTo(byte[]
buffer to copy the mode to. buf, int position within ptr)buf for first digit.Copy this mode as a sequence of octal US-ASCII bytes. |
| public int | Returns: the number of bytes written bycopyTo(OutputStream).Copy the number of bytes written by |
| public abstract boolean | Returns: true if the mode bits represent the same mode as this objecta int. modeBits)Test a file mode for equality with this
|
| public static final FileMode | Returns: the FileMode instance that represents the given bits.the mode bits the caller has somehow obtained. bits)Convert a set of mode bits into a FileMode enumerated value. |
| public int | |
| public int | Returns: one of the well known object type constants.Get the object type that should appear for this type of mode. |
| public String |
| EXECUTABLE_FILE | back to summary |
|---|---|
| public static final FileMode EXECUTABLE_FILE Mode indicating an entry is an executable file. | |
| GITLINK | back to summary |
|---|---|
| public static final FileMode GITLINK Mode indicating an entry is a submodule commit in another repository. | |
| MISSING | back to summary |
|---|---|
| public static final FileMode MISSING Mode indicating an entry is missing during parallel walks. | |
| modeBits | back to summary |
|---|---|
| private final int modeBits | |
| objectType | back to summary |
|---|---|
| private final int objectType | |
| octalBytes | back to summary |
|---|---|
| private final byte[] octalBytes | |
| REGULAR_FILE | back to summary |
|---|---|
| public static final FileMode REGULAR_FILE Mode indicating an entry is a non-executable file. | |
| SYMLINK | back to summary |
|---|---|
| public static final FileMode SYMLINK Mode indicating an entry is a symbolic link. | |
| TREE | back to summary |
|---|---|
| public static final FileMode TREE Mode indicating an entry is a tree (aka directory). | |
| TYPE_FILE | back to summary |
|---|---|
| public static final int TYPE_FILE Bit pattern for | |
| TYPE_GITLINK | back to summary |
|---|---|
| public static final int TYPE_GITLINK | |
| TYPE_MASK | back to summary |
|---|---|
| public static final int TYPE_MASK Mask to apply to a file mode to obtain its type bits.
| |
| TYPE_MISSING | back to summary |
|---|---|
| public static final int TYPE_MISSING | |
| TYPE_SYMLINK | back to summary |
|---|---|
| public static final int TYPE_SYMLINK | |
| TYPE_TREE | back to summary |
|---|---|
| public static final int TYPE_TREE | |
| FileMode | back to summary |
|---|---|
| private FileMode(int mode, int expType) | |
| copyTo | back to summary |
|---|---|
| public void copyTo(OutputStream os) throws IOException Copy this mode as a sequence of octal US-ASCII bytes. The mode is copied as a sequence of octal digits using the US-ASCII character encoding. The sequence does not use a leading '0' prefix to indicate octal notation. This method is suitable for generation of a mode string within a GIT tree object.
| |
| copyTo | back to summary |
|---|---|
| public void copyTo(byte[] buf, int ptr) Copy this mode as a sequence of octal US-ASCII bytes. The mode is copied as a sequence of octal digits using the US-ASCII character encoding. The sequence does not use a leading '0' prefix to indicate octal notation. This method is suitable for generation of a mode string within a GIT tree object.
| |
| copyToLength | back to summary |
|---|---|
| public int copyToLength() Copy the number of bytes written by
| |
| equals | back to summary |
|---|---|
| public abstract boolean equals(int modeBits) Test a file mode for equality with this
| |
| fromBits | back to summary |
|---|---|
| public static final FileMode fromBits(int bits) Convert a set of mode bits into a FileMode enumerated value.
| |
| getBits | back to summary |
|---|---|
| public int getBits() Get the mode bits as an integer.
| |
| getObjectType | back to summary |
|---|---|
| public int getObjectType() Get the object type that should appear for this type of mode.
See the object type constants in
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non- Format this mode as an octal string (for debugging only). | |