|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.perforce.api.SourceControlObject
com.perforce.api.FileEntry
public final class 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,
java.lang.String p)
Constructs a file entry using the environment and path. |
|
FileEntry(java.lang.String p)
Constructs a file entry using the path. |
|
| Method Summary | |
|---|---|
static FileEntry |
checkIn(Env env,
java.lang.String path,
java.lang.String description)
Checks in a file that has already been opened on the client using the description given. |
void |
commit()
No-op. |
static java.lang.String |
customizePath(java.lang.String str,
char from_char,
char to_char)
Returns the path after converting characters. |
static java.lang.String |
depotizePath(java.lang.String path)
Returns the path in depot format. |
HashDecay |
getCache()
Returns the HashDecay instance for this class |
java.lang.String |
getClientPath()
Returns the client path for this file. |
java.lang.String |
getDepotPath()
Returns the depot path for this file. |
java.lang.String |
getDescription()
Returns the decription for this file |
static FileEntry |
getFile(java.lang.String p)
Gets the file information for the specified path. |
java.lang.String |
getFileContents()
Returns a String that contains this file's contents. |
java.lang.String |
getFileContents(Env env,
java.lang.String path)
Returns a String that contains this file's contents. |
static java.util.Vector |
getFileLog(Env env,
java.lang.String path)
Returns a list of FileEntry objects that represent the
history of the specified file. |
static java.util.Vector |
getFiles(Env env,
java.lang.String path)
Returns the list of files for the path. |
int |
getHaveRev()
Returns the revision number the client has for this file. |
java.lang.String |
getHeadAction()
Returns the head revision action for this file. |
int |
getHeadChange()
Returns the head revision change number for this file. |
java.lang.String |
getHeadDate()
Returns a String representation of date for the head revsision of the file. |
int |
getHeadRev()
Returns the head revision number for this file. |
long |
getHeadTime()
Returns the head revision time for this file. |
java.lang.String |
getHeadTimeString()
Returns the head revision time as a String for this file. |
java.lang.String |
getHeadType()
Returns the head revision type for this file. |
java.lang.String |
getName()
Returns the file name. |
static java.util.Vector |
getOpened()
Returns a list of files that are open for edit or add. |
static java.util.Vector |
getOpened(Env env,
boolean stat)
Returns a list of files that are open for edit or add. |
static java.util.Vector |
getOpened(Env env,
boolean stat,
boolean all,
int changelist,
java.util.Vector files)
Returns a list of files that are open for edit or add. |
java.lang.String |
getOwner()
Returns the owner for this file |
FileEntry |
getSource()
Returns the source file entry associated with this file. |
static java.lang.String |
HTMLEncode(java.lang.String str)
Deprecated. Don't use this anymore. |
static java.lang.String |
localizePath(java.lang.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,
java.lang.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,
java.lang.String path,
boolean sync,
boolean force,
boolean lock,
Change chng)
Opens the file on the path for edit under the change. |
void |
reopen(java.lang.String type,
Change chng)
Reopens the file with the new type or in the new change list. |
java.lang.String |
resolve(boolean force)
Resolves this file. |
static java.lang.String |
resolveAll(Env env,
java.lang.String flags,
java.lang.String path)
Resolves all the files in the path. |
static java.lang.String |
resolveAT(Env env,
java.util.Enumeration en)
Forces a resolve on a set of files. |
boolean |
revert()
Reverts this file. |
void |
setClientPath(java.lang.String p)
Sets the client path for this file. |
void |
setDepotPath(java.lang.String p)
Sets the depot path for this file. |
void |
setDescription(java.lang.String d)
Sets the decription for this file |
void |
setHaveRev(int rev)
Sets the revision number the client has for this file. |
void |
setHeadAction(java.lang.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(java.lang.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(java.lang.String type)
Sets the head revision type for this file. |
void |
setOwner(java.lang.String o)
Sets the owner for this file |
void |
setSource(FileEntry fent)
Sets the source file entry associated with this file. |
void |
setTimeFormat(java.lang.String format)
Sets the format used by the getHeadTimeString method. |
void |
sync()
Brings this object back into sync with Perforce. |
static java.util.Vector |
synchronizeWorkspace(Env env,
java.lang.String path)
Returns a Vector of FileEntry objects that
reflect what files were changed by the sync process. |
java.lang.String |
syncMySpace(Env env,
java.lang.String path)
Deprecated. |
static java.lang.String |
syncWorkspace(Env env,
java.lang.String path)
Synchronizes the workspace. |
java.lang.String |
toString()
|
java.lang.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,
java.lang.String p)
env - Source control environement to use.p - Path to the file.public FileEntry(java.lang.String p)
p - Path to the file.| Method Detail |
|---|
public HashDecay getCache()
SourceControlObject
getCache in interface CacheablegetCache in class SourceControlObjectpublic void setDescription(java.lang.String d)
public java.lang.String getDescription()
public void setOwner(java.lang.String o)
public java.lang.String getOwner()
public void setSource(FileEntry fent)
public FileEntry getSource()
public void setHeadType(java.lang.String type)
public java.lang.String getHeadType()
public void setHeadDate(java.lang.String date)
public java.lang.String getHeadDate()
public void setHeadTime(long time)
public long getHeadTime()
public void setTimeFormat(java.lang.String format)
An example format would be setTimeFormat("MM/dd HH:mm:ss");
SimpleDateFormatpublic java.lang.String getHeadTimeString()
String for this file.
public void setHeadAction(java.lang.String action)
public java.lang.String getHeadAction()
public void setHeadChange(int change)
public int getHeadChange()
public void setHeadRev(int rev)
public int getHeadRev()
public void setHaveRev(int rev)
public int getHaveRev()
public void setDepotPath(java.lang.String p)
p - path for this file in the depot.public java.lang.String getDepotPath()
public static java.lang.String localizePath(java.lang.String path)
public static java.lang.String depotizePath(java.lang.String path)
public static java.lang.String customizePath(java.lang.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 java.lang.String resolve(boolean force)
throws java.io.IOException
force - Indicates whether the resolve should be forced.
java.io.IOException
public static java.lang.String resolveAT(Env env,
java.util.Enumeration en)
throws java.io.IOException
Enumeration
contains the set of FileEntry objects that need resolved.
env - Source control environment to use.en - Enumeration of FileEntry.
java.io.IOException
public static java.lang.String resolveAll(Env env,
java.lang.String flags,
java.lang.String path)
throws java.io.IOException
env - Source control environment to use.flags - 'p4 resolve' command flags.path - Path over which to resolve. May include wildcards.
java.io.IOExceptionpublic static java.lang.String HTMLEncode(java.lang.String str)
public java.lang.String getName()
public void setClientPath(java.lang.String p)
p - path for this file on the client system.public java.lang.String getClientPath()
public static FileEntry getFile(java.lang.String p)
p - Path of the file to gather information about.
public static java.util.Vector getFiles(Env env,
java.lang.String path)
env - Source control environment to use.path - Path for set of files.
public static java.util.Vector getFileLog(Env env,
java.lang.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 FileEntry openForEdit(Env env,
java.lang.String path,
boolean sync,
boolean force,
boolean lock,
Change chng)
throws java.lang.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.
java.lang.Exception
public void openForEdit()
throws java.lang.Exception
java.lang.ExceptionopenForEdit(Env, String, boolean, boolean, boolean, Change)
public void openForEdit(boolean force,
boolean lock)
throws java.lang.Exception
java.lang.ExceptionopenForEdit(Env, String, boolean, boolean, boolean, Change)
public void openForEdit(boolean force,
boolean lock,
Change chng)
throws java.lang.Exception
java.lang.ExceptionopenForEdit(Env, String, boolean, boolean, boolean, Change)
public void obtainLock()
throws java.lang.Exception
java.lang.Exception
public static FileEntry openForAdd(Env env,
java.lang.String path,
Change chng)
throws java.lang.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.
java.lang.Exception
public void openForAdd()
throws java.lang.Exception
java.lang.ExceptionopenForAdd(Env, String, Change)
public void openForAdd(Change chng)
throws java.lang.Exception
java.lang.ExceptionopenForAdd(Env, String, Change)
public static FileEntry checkIn(Env env,
java.lang.String path,
java.lang.String description)
throws PerforceException
FileEntry contains the latest
information for the checked-in file.
PerforceException
public void reopen(java.lang.String type,
Change chng)
throws PerforceException
PerforceExceptionpublic boolean revert()
public static java.util.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 java.util.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 java.util.Vector getOpened(Env env,
boolean stat,
boolean all,
int changelist,
java.util.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.
If changelist is 0, all the changes in the default changelist are returned. If it is less than 0, all opened files are returned.
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 void commit()
commit in interface Cacheablecommit in class SourceControlObject
public java.lang.String syncMySpace(Env env,
java.lang.String path)
throws java.io.IOException
java.io.IOExceptionsyncWorkspace(Env, String)
public static java.util.Vector synchronizeWorkspace(Env env,
java.lang.String path)
throws java.io.IOException
Vector of FileEntry objects that
reflect what files were changed by the sync process. If path is null, the
entire workspace is synchronized to the head revision. The path may
contain wildcard characters, as with the command line 'p4 sync' command.
env - Source control environment.path - Path to synchronize. May include wildcards.
java.io.IOException
public static java.lang.String syncWorkspace(Env env,
java.lang.String path)
throws java.io.IOException
env - Source control environment.path - Path to synchronize. May include wildcards.
java.io.IOExceptionpublic java.lang.String getFileContents()
String that contains this file's contents. This
only works well for text files.
public java.lang.String getFileContents(Env env,
java.lang.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 void sync()
SourceControlObject
sync in interface Cacheablesync in class SourceControlObjectpublic java.lang.String toString()
toString in class java.lang.Objectpublic java.lang.String toXML()
SourceControlObject
toXML in class SourceControlObject
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||