|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.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,
String p)
Constructs a file entry using the environment and path. |
|
FileEntry(String p)
Constructs a file entry using the path. |
Method Summary | |
---|---|
static FileEntry |
checkIn(Env env,
String path,
String description)
Checks in a file that has already been opened on the client using the description given. |
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 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. |
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 |
openForDelete(Change chng)
Opens this file for deletion. |
void |
openForEdit()
Opens this file for edit. |
void |
openForEdit(boolean lock)
Opens this file for edit. |
void |
openForEdit(boolean lock,
Change chng)
Opens this file for edit. |
static FileEntry |
openForEdit(Env env,
String path,
boolean sync,
boolean lock,
Change chng)
Opens the file on the path for edit under the change. |
void |
reopen(String type,
Change chng)
Reopens the file with the new type or in the new change list. |
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 |
setTimeFormat(String format)
Sets the format used by the getHeadTimeString method. |
void |
sync()
Brings this object back into sync with Perforce. |
static Vector |
synchronizeWorkspace(Env env,
String path)
Returns a Vector of FileEntry objects that
reflect what files were changed by the sync process. |
static String |
syncWorkspace(Env env,
String path)
Synchronizes the workspace. |
static String |
syncWorkspace(Env env,
String path,
boolean force)
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 static FileEntry checkIn(Env env, String path, String description) throws PerforceException
FileEntry
contains the latest
information for the checked-in file.
PerforceException
public void commit()
commit
in interface Cacheable
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 interface Cacheable
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.
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 String getOwner()
public FileEntry getSource()
public static String localizePath(String path)
public void obtainLock() throws Exception
Exception
public void openForAdd() throws Exception
Exception
openForAdd(Env, String, Change)
public void openForAdd(Change chng) throws Exception
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.
Exception
public void openForDelete(Change chng) throws Exception
Exception
public void openForEdit() throws Exception
Exception
openForEdit(Env, String, boolean, boolean, Change)
public void openForEdit(boolean lock) throws Exception
Exception
openForEdit(Env, String, boolean, boolean, Change)
public void openForEdit(boolean lock, Change chng) throws Exception
Exception
openForEdit(Env, String, boolean, boolean, Change)
public static FileEntry openForEdit(Env env, String path, boolean sync, 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.lock
- If true, the file will be locked once opened.chng
- The change that the file will be opened for edit in.
Exception
public void reopen(String type, Change chng) throws PerforceException
PerforceException
public String resolve(boolean force) throws IOException
force
- Indicates whether the resolve should be forced.
IOException
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.
IOException
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
.
IOException
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 setTimeFormat(String format)
An example format would be setTimeFormat("MM/dd HH:mm:ss");
SimpleDateFormat
public void sync()
SourceControlObject
sync
in interface Cacheable
sync
in class SourceControlObject
public static Vector synchronizeWorkspace(Env env, String path) throws 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.
IOException
public static String syncWorkspace(Env env, String path) throws IOException
env
- Source control environment.path
- Path to synchronize. May include wildcards.
IOException
public static String syncWorkspace(Env env, String path, boolean force) throws IOException
env
- Source control environment.path
- Path to synchronize. May include wildcards.force
- Whether to do a force sync
IOException
public String toString()
toString
in class Object
public String toXML()
SourceControlObject
toXML
in class SourceControlObject
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |