|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.perforce.api.SourceControlObject | +--com.perforce.api.FileEntry
Representation of a source control file.
Hashtable
Constructor Summary | |
FileEntry()
Default no-argument constructor. |
|
FileEntry(Env env)
Constructs a file entry using the environment. |
|
FileEntry(Env env,
String p)
Constructs a file entry using the environment and path. |
|
FileEntry(String p)
Constructs a file entry using the path. |
Method Summary | |
void |
commit()
No-op. |
static String |
customizePath(String str,
char from_char,
char to_char)
Returns the path after converting characters. |
static String |
depotizePath(String path)
Returns the path in depot format. |
HashDecay |
getCache()
Returns the HashDecay instance for this class |
String |
getClientPath()
Returns the client path for this file. |
String |
getDepotPath()
Returns the depot path for this file. |
String |
getDescription()
Returns the decription for this file |
static FileEntry |
getFile(String p)
Gets the file information for the specified path. |
String |
getFileContents()
Returns a String that contains this file's contents. |
String |
getFileContents(Env env,
String path)
Returns a String that contains this file's contents. |
static Vector |
getFileLog(Env env,
String path)
Returns a list of FileEntry objects that represent the
history of the specified file. |
static Vector |
getFiles(Env env,
String path)
Returns the list of files for the path. |
int |
getHaveRev()
Returns the revision number the client has for this file. |
String |
getHeadAction()
Returns the head revision action for this file. |
int |
getHeadChange()
Returns the head revision change number for this file. |
String |
getHeadDate()
Returns the head date for this file. |
int |
getHeadRev()
Returns the head revision number for this file. |
long |
getHeadTime()
Returns the head revision time for this file. |
String |
getHeadTimeString()
Returns the head revision time as a String for this file. |
String |
getHeadType()
Returns the head revision type for this file. |
String |
getName()
Returns the file name. |
static Vector |
getOpened()
Returns a list of files that are open for edit or add. |
static Vector |
getOpened(Env env,
boolean stat)
Returns a list of files that are open for edit or add. |
static Vector |
getOpened(Env env,
boolean stat,
boolean all,
int changelist,
Vector files)
Returns a list of files that are open for edit or add. |
String |
getOwner()
Returns the owner for this file |
FileEntry |
getSource()
Returns the source file entry associated with this file. |
static String |
localizePath(String path)
Returns the path in local format. |
void |
obtainLock()
Obtains the lock for this file. |
void |
openForAdd()
Opens this file for addition. |
void |
openForAdd(Change chng)
Opens this file for addition. |
static FileEntry |
openForAdd(Env env,
String path,
Change chng)
Opens the file on the path for add under the change. |
void |
openForEdit()
Opens this file for edit. |
void |
openForEdit(boolean force,
boolean lock)
Opens this file for edit. |
void |
openForEdit(boolean force,
boolean lock,
Change chng)
Opens this file for edit. |
static FileEntry |
openForEdit(Env env,
String path,
boolean sync,
boolean force,
boolean lock,
Change chng)
Opens the file on the path for edit under the change. |
String |
resolve(boolean force)
Resolves this file. |
static String |
resolveAll(Env env,
String flags,
String path)
Resolves all the files in the path. |
static String |
resolveAT(Env env,
Enumeration en)
Forces a resolve on a set of files. |
boolean |
revert()
Reverts this file. |
void |
setClientPath(String p)
Sets the client path for this file. |
void |
setDepotPath(String p)
Sets the depot path for this file. |
void |
setDescription(String d)
Sets the decription for this file |
void |
setHaveRev(int rev)
Sets the revision number the client has for this file. |
void |
setHeadAction(String action)
Sets the head revision action for this file. |
void |
setHeadChange(int change)
Sets the head revision change number for this file. |
void |
setHeadDate(String date)
Sets the head date for this file. |
void |
setHeadRev(int rev)
Sets the head revision number for this file. |
void |
setHeadTime(long time)
Sets the head revision time for this file. |
void |
setHeadType(String type)
Sets the head revision type for this file. |
void |
setOwner(String o)
Sets the owner for this file |
void |
setSource(FileEntry fent)
Sets the source file entry associated with this file. |
void |
sync()
Brings this object back into sync with Perforce. |
static String |
syncWorkspace(Env env,
String path)
Synchronizes the workspace. |
String |
toString()
|
String |
toXML()
Returns a string containing the object in XML form. |
Methods inherited from class com.perforce.api.SourceControlObject |
clearCache, getEnv, getSyncTime, getUpdateTime, inSync, invalidate, outOfSync, refreshUpdateTime, setEnv |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public FileEntry()
public FileEntry(Env env)
env
- Source control environement to use.public FileEntry(Env env, String p)
env
- Source control environement to use.p
- Path to the file.public FileEntry(String p)
p
- Path to the file.Method Detail |
public void commit()
commit
in class SourceControlObject
public static String customizePath(String str, char from_char, char to_char)
str
- String to convert.from_char
- Character to be changed from.to_char
- Character to be changed to.public static String depotizePath(String path)
public HashDecay getCache()
SourceControlObject
getCache
in class SourceControlObject
public String getClientPath()
public String getDepotPath()
public String getDescription()
public static FileEntry getFile(String p)
p
- Path of the file to gather information about.public String getFileContents()
String
that contains this file's contents. This
only works well for text files.public String getFileContents(Env env, String path)
String
that contains this file's contents. This
only works well for text files.env
- Source control environment.path
- Path to the file. Must be specific. No wildcards.public static Vector getFileLog(Env env, String path)
FileEntry
objects that represent the
history of the specified file.env
- Source control environment to use.path
- Path to the file. Must be specific. No wildcards.public static Vector getFiles(Env env, String path)
env
- Source control environment to use.path
- Path for set of files.public int getHaveRev()
public String getHeadAction()
public int getHeadChange()
public String getHeadDate()
public int getHeadRev()
public long getHeadTime()
public String getHeadTimeString()
String
for this file.public String getHeadType()
public String getName()
public static Vector getOpened()
Vectore
of FileEntry
objects.
The only information that is valid for the object will be the path,
until the sync
method is called.public static Vector getOpened(Env env, boolean stat)
Vectore
of FileEntry
objects.
Getting the stats for each FileEntry
is a more expensive
operation. By default, this is not done. What this means is that the
only information that is valid for the object will be the path, until the
sync
method is called.
env
- Source control environment to use.stat
- Indicates that file statistics should be gathered.public static Vector getOpened(Env env, boolean stat, boolean all, int changelist, Vector files)
Vector
of FileEntry
objects.
Getting the stats for each FileEntry
is a more expensive
operation. By default, this is not done. What this means is that the
only information that is valid for the object will be the path, until the
sync
method is called.
env
- Source control environment to use.stat
- Indicates that file statistics should be gathered.all
- Indicates that all open files should be returned.changelist
- If non-zero, show files open in this changelist.files
- If non-null, show files open in this Vector
of FileEntry
objects.public String getOwner()
public FileEntry getSource()
public static String localizePath(String path)
public void obtainLock() throws Exception
public void openForAdd() throws Exception
openForAdd(Env, String, Change)
public void openForAdd(Change chng) throws Exception
openForAdd(Env, String, Change)
public static FileEntry openForAdd(Env env, String path, Change chng) throws Exception
env
- P4 Environmentpath
- Depot or client path to the file being opened for add.chng
- The change that the file will be opened for add in.public void openForEdit() throws Exception
openForEdit(Env, String, boolean, boolean, boolean, Change)
public void openForEdit(boolean force, boolean lock) throws Exception
openForEdit(Env, String, boolean, boolean, boolean, Change)
public void openForEdit(boolean force, boolean lock, Change chng) throws Exception
openForEdit(Env, String, boolean, boolean, boolean, Change)
public static FileEntry openForEdit(Env env, String path, boolean sync, boolean force, boolean lock, Change chng) throws Exception
env
- P4 Environmentpath
- Depot or client path to the file being opened for edit.sync
- If true, the file will be sync'd before opened for edit.force
- If true, the file will be opened for edit even if it isn't the most recent version.lock
- If true, the file will be locked once opened.chng
- The change that the file will be opened for edit in.public String resolve(boolean force) throws IOException
force
- Indicates whether the resolve should be forces.public static String resolveAll(Env env, String flags, String path) throws IOException
env
- Source control environment to use.flags
- 'p4 resolve' command flags.path
- Path over which to resolve. May include wildcards.public static String resolveAT(Env env, Enumeration en) throws IOException
Enumeration
contains
the set of FileEntry
objects that need resolved.env
- Source control environment to use.en
- Enumeration
of FileEntry
.public boolean revert()
public void setClientPath(String p)
p
- path for this file on the client system.public void setDepotPath(String p)
p
- path for this file in the depot.public void setDescription(String d)
public void setHaveRev(int rev)
public void setHeadAction(String action)
public void setHeadChange(int change)
public void setHeadDate(String date)
public void setHeadRev(int rev)
public void setHeadTime(long time)
public void setHeadType(String type)
public void setOwner(String o)
public void setSource(FileEntry fent)
public void sync()
SourceControlObject
sync
in class SourceControlObject
public static String syncWorkspace(Env env, String path) throws IOException
env
- Source control environment.path
- Path to synchronize. May include wildcards.public String toString()
toString
in class Object
public String toXML()
SourceControlObject
toXML
in class SourceControlObject
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |