org.eclipse.jgit.lib
Class FileTreeEntry

java.lang.Object
  extended by org.eclipse.jgit.lib.TreeEntry
      extended by org.eclipse.jgit.lib.FileTreeEntry
All Implemented Interfaces:
java.lang.Comparable

public class FileTreeEntry
extends TreeEntry

A representation of a file (blob) object in a Tree.


Field Summary
 
Fields inherited from class org.eclipse.jgit.lib.TreeEntry
CONCURRENT_MODIFICATION, LOADED_ONLY, MODIFIED_ONLY
 
Constructor Summary
FileTreeEntry(Tree parent, ObjectId id, byte[] nameUTF8, boolean execute)
          Constructor for a File (blob) object.
 
Method Summary
 void accept(TreeVisitor tv, int flags)
          Visit the members of this TreeEntry.
 FileMode getMode()
           
 boolean isExecutable()
           
 ObjectLoader openReader()
           
 void setExecutable(boolean execute)
           
 java.lang.String toString()
           
 
Methods inherited from class org.eclipse.jgit.lib.TreeEntry
accept, compareTo, delete, detachParent, getFullName, getFullNameUTF8, getId, getName, getNameUTF8, getParent, getRepository, isModified, lastChar, lastChar, rename, rename, setId, setModified
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FileTreeEntry

public FileTreeEntry(Tree parent,
                     ObjectId id,
                     byte[] nameUTF8,
                     boolean execute)
Constructor for a File (blob) object.

Parameters:
parent - The Tree holding this object (or null)
id - the SHA-1 of the blob (or null for a yet unhashed file)
nameUTF8 - raw object name in the parent tree
execute - true if the executable flag is set
Method Detail

getMode

public FileMode getMode()
Specified by:
getMode in class TreeEntry
Returns:
mode (type of object)

isExecutable

public boolean isExecutable()
Returns:
true if this file is executable

setExecutable

public void setExecutable(boolean execute)
Parameters:
execute - set/reset the executable flag

openReader

public ObjectLoader openReader()
                        throws java.io.IOException
Returns:
an ObjectLoader that will return the data
Throws:
java.io.IOException

accept

public void accept(TreeVisitor tv,
                   int flags)
            throws java.io.IOException
Description copied from class: TreeEntry
Visit the members of this TreeEntry.

Specified by:
accept in class TreeEntry
Parameters:
tv - A visitor object doing the work
flags - Specification for what members to visit. See TreeEntry.MODIFIED_ONLY, TreeEntry.LOADED_ONLY, TreeEntry.CONCURRENT_MODIFICATION.
Throws:
java.io.IOException

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object