com.perforce.p4java.ant.tasks
Class FstatTask

java.lang.Object
  extended by org.apache.tools.ant.ProjectComponent
      extended by org.apache.tools.ant.Task
          extended by com.perforce.p4java.ant.tasks.PerforceTask
              extended by com.perforce.p4java.ant.tasks.ServerTask
                  extended by com.perforce.p4java.ant.tasks.ClientTask
                      extended by com.perforce.p4java.ant.tasks.FstatTask
All Implemented Interfaces:
java.lang.Cloneable

public class FstatTask
extends ClientTask

Dumps information about each file, with each item of information on a separate line. It is best used within a Perforce API application where the items can be accessed as variables, but its output is also suitable for parsing from the client command output.

See Also:
PerforceTask, ServerTask

Nested Class Summary
 
Nested classes/interfaces inherited from class com.perforce.p4java.ant.tasks.ServerTask
ServerTask.GlobalOption
 
Nested classes/interfaces inherited from class com.perforce.p4java.ant.tasks.PerforceTask
PerforceTask.Field, PerforceTask.File
 
Field Summary
protected  int affectedByChangelist
          Instructs fstat to display only files affected by the given changelist number.
protected  java.lang.String filterString
          Limits the output to files satisfying the expression given as 'filter'.
protected  int maxResults
          Limits output to the first 'max' number of files.
protected  java.util.List<IExtendedFileSpec> retExtendedFileSpecs
          Collection of extended file and revision specifiers returned from the Perforce command.
protected  boolean reverseSort
          Sorts the output in reverse order.
protected  int sinceChangelist
          Instructs fstat to display only files affected since the given changelist number.
protected  boolean sortByDate
          Sort by date.
protected  boolean sortByFileSize
          Sort by filesize.
protected  boolean sortByFiletype
          Sort by filetype.
protected  boolean sortByHaveRev
          Sort by have revision.
protected  boolean sortByHeadRev
          Sort by head revision.
 
Fields inherited from class com.perforce.p4java.ant.tasks.ClientTask
p4Client
 
Fields inherited from class com.perforce.p4java.ant.tasks.ServerTask
allHosts, commandOptions, globaloptions, hostName, P4_SERVER_PROTOCOL_PROPERTIES_FILE, P4_SERVER_USAGE_PROPERTIES_FILE, p4Server, programName, programVersion, protocolPropertiesFile, protocolProps, textLanguage, unsetClientName, unsetUserName, usagePropertiesFile, usageProps, workingDirectory
 
Fields inherited from class com.perforce.p4java.ant.tasks.PerforceTask
charset, client, failOnError, fields, FILE_TOKEN_REGEX_PATTERN, fileList, files, fileSpecs, LINE_PADDING, LINE_SEPARATOR, p4Messages, passwd, port, protocol, retFileSpecs, retStatusMessage, user
 
Fields inherited from class org.apache.tools.ant.Task
target, taskName, taskType, wrapper
 
Fields inherited from class org.apache.tools.ant.ProjectComponent
description, location, project
 
Constructor Summary
FstatTask()
          Default constructor.
 
Method Summary
protected  void execP4Command()
          Execute the Perforce fstat command with file specs and options.
 java.util.List<IExtendedFileSpec> getRetExtendedFileSpecs()
          Gets the ret extended file specs.
 void setAffectedByChangelist(int affectedByChangelist)
          Sets the affected by changelist.
 void setAllRevs(boolean allRevs)
          Sets the all revs.
 void setBothPathTypes(boolean bothPathTypes)
          Sets the both path types.
 void setExcludeLocalPath(boolean excludeLocalPath)
          Sets the exclude local path.
 void setFileSizeDigest(boolean fileSizeDigest)
          Sets the file size digest.
 void setFilterString(java.lang.String filterString)
          Sets the filter string.
 void setMappedFiles(boolean mappedFiles)
          Sets the mapped files.
 void setMaxResults(int maxResults)
          Sets the max results.
 void setOpenedFiles(boolean openedFiles)
          Sets the opened files.
 void setOpenedNeedsResolvingFiles(boolean openedNeedsResolvingFiles)
          Sets the opened needs resolving files.
 void setOpenedNotHeadRevFiles(boolean openedNotHeadRevFiles)
          Sets the opened not head rev files.
 void setOpenedResolvedFiles(boolean openedResolvedFiles)
          Sets the opened resolved files.
 void setPendingIntegrationRecs(boolean pendingIntegrationRecs)
          Sets the pending integration recs.
 void setReverseSort(boolean reverseSort)
          Sets the reverse sort.
 void setShelvedFiles(boolean shelvedFiles)
          Sets the shelved files.
 void setSinceChangelist(int sinceChangelist)
          Sets the since changelist.
 void setSortByDate(boolean sortByDate)
          Sets the sort by date.
 void setSortByFileSize(boolean sortByFileSize)
          Sets the sort by file size.
 void setSortByFiletype(boolean sortByFiletype)
          Sets the sort by filetype.
 void setSortByHaveRev(boolean sortByHaveRev)
          Sets the sort by have rev.
 void setSortByHeadRev(boolean sortByHeadRev)
          Sets the sort by head rev.
 void setSyncedFiles(boolean syncedFiles)
          Sets the synced files.
 
Methods inherited from class com.perforce.p4java.ant.tasks.ClientTask
cleanupP4, getP4Client, initP4, setP4Client
 
Methods inherited from class com.perforce.p4java.ant.tasks.ServerTask
cleanupP4Server, createGlobalOption, getGlobalOptions, getP4Server, initP4Server, initP4ServerOptions, setAllHosts, setHostName, setP4Server, setProgramName, setProgramVersion, setProtocolPropertiesFile, setProtocolProps, setTextLanguage, setUnsetClientName, setUnsetUserName, setUsagePropertiesFile, setUsageProps, setWorkingDirectory
 
Methods inherited from class com.perforce.p4java.ant.tasks.PerforceTask
addFileset, createField, createFile, execute, getFields, getFiles, getFileSpecs, getRetFileSpecs, getRetStatusMessage, init, isEmpty, logChangelistSummaries, logChangelistSummary, logExtendedFileSpec, logExtendedFileSpecs, logFileDiff, logFileDiffs, logFileLineMatch, logFileLineMatches, logFileSpec, logFileSpecs, logFix, logFixes, logJob, logJobs, parseChangelist, setCharset, setClient, setFailOnError, setFiles, setPasswd, setPort, setProtocol, setUser
 
Methods inherited from class org.apache.tools.ant.Task
bindToOwner, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, isInvalid, log, log, log, log, maybeConfigure, perform, reconfigure, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType
 
Methods inherited from class org.apache.tools.ant.ProjectComponent
clone, getDescription, getLocation, getProject, setDescription, setLocation, setProject
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

filterString

protected java.lang.String filterString
Limits the output to files satisfying the expression given as 'filter'. Example, fstat -Ol -F "fileSize > 1000000 & headType=text".


maxResults

protected int maxResults
Limits output to the first 'max' number of files.


reverseSort

protected boolean reverseSort
Sorts the output in reverse order.


sinceChangelist

protected int sinceChangelist
Instructs fstat to display only files affected since the given changelist number.


affectedByChangelist

protected int affectedByChangelist
Instructs fstat to display only files affected by the given changelist number.


sortByFiletype

protected boolean sortByFiletype
Sort by filetype.


sortByDate

protected boolean sortByDate
Sort by date.


sortByHeadRev

protected boolean sortByHeadRev
Sort by head revision.


sortByHaveRev

protected boolean sortByHaveRev
Sort by have revision.


sortByFileSize

protected boolean sortByFileSize
Sort by filesize.


retExtendedFileSpecs

protected java.util.List<IExtendedFileSpec> retExtendedFileSpecs
Collection of extended file and revision specifiers returned from the Perforce command.

Constructor Detail

FstatTask

public FstatTask()
Default constructor.

Method Detail

setFilterString

public void setFilterString(java.lang.String filterString)
Sets the filter string.

Parameters:
filterString - the new filter string

setMaxResults

public void setMaxResults(int maxResults)
Sets the max results.

Parameters:
maxResults - the new max results

setReverseSort

public void setReverseSort(boolean reverseSort)
Sets the reverse sort.

Parameters:
reverseSort - the new reverse sort

setSinceChangelist

public void setSinceChangelist(int sinceChangelist)
Sets the since changelist.

Parameters:
sinceChangelist - the new since changelist

setAffectedByChangelist

public void setAffectedByChangelist(int affectedByChangelist)
Sets the affected by changelist.

Parameters:
affectedByChangelist - the new affected by changelist

setSortByFiletype

public void setSortByFiletype(boolean sortByFiletype)
Sets the sort by filetype.

Parameters:
sortByFiletype - the new sort by filetype

setSortByDate

public void setSortByDate(boolean sortByDate)
Sets the sort by date.

Parameters:
sortByDate - the new sort by date

setSortByHeadRev

public void setSortByHeadRev(boolean sortByHeadRev)
Sets the sort by head rev.

Parameters:
sortByHeadRev - the new sort by head rev

setSortByHaveRev

public void setSortByHaveRev(boolean sortByHaveRev)
Sets the sort by have rev.

Parameters:
sortByHaveRev - the new sort by have rev

setSortByFileSize

public void setSortByFileSize(boolean sortByFileSize)
Sets the sort by file size.

Parameters:
sortByFileSize - the new sort by file size

setMappedFiles

public void setMappedFiles(boolean mappedFiles)
Sets the mapped files.

Parameters:
mappedFiles - the new mapped files

setSyncedFiles

public void setSyncedFiles(boolean syncedFiles)
Sets the synced files.

Parameters:
syncedFiles - the new synced files

setOpenedNotHeadRevFiles

public void setOpenedNotHeadRevFiles(boolean openedNotHeadRevFiles)
Sets the opened not head rev files.

Parameters:
openedNotHeadRevFiles - the new opened not head rev files

setOpenedFiles

public void setOpenedFiles(boolean openedFiles)
Sets the opened files.

Parameters:
openedFiles - the new opened files

setOpenedResolvedFiles

public void setOpenedResolvedFiles(boolean openedResolvedFiles)
Sets the opened resolved files.

Parameters:
openedResolvedFiles - the new opened resolved files

setOpenedNeedsResolvingFiles

public void setOpenedNeedsResolvingFiles(boolean openedNeedsResolvingFiles)
Sets the opened needs resolving files.

Parameters:
openedNeedsResolvingFiles - the new opened needs resolving files

setShelvedFiles

public void setShelvedFiles(boolean shelvedFiles)
Sets the shelved files.

Parameters:
shelvedFiles - the new shelved files

setAllRevs

public void setAllRevs(boolean allRevs)
Sets the all revs.

Parameters:
allRevs - the new all revs

setFileSizeDigest

public void setFileSizeDigest(boolean fileSizeDigest)
Sets the file size digest.

Parameters:
fileSizeDigest - the new file size digest

setBothPathTypes

public void setBothPathTypes(boolean bothPathTypes)
Sets the both path types.

Parameters:
bothPathTypes - the new both path types

setPendingIntegrationRecs

public void setPendingIntegrationRecs(boolean pendingIntegrationRecs)
Sets the pending integration recs.

Parameters:
pendingIntegrationRecs - the new pending integration recs

setExcludeLocalPath

public void setExcludeLocalPath(boolean excludeLocalPath)
Sets the exclude local path.

Parameters:
excludeLocalPath - the new exclude local path

getRetExtendedFileSpecs

public java.util.List<IExtendedFileSpec> getRetExtendedFileSpecs()
Gets the ret extended file specs.

Returns:
the ret extended file specs

execP4Command

protected void execP4Command()
                      throws org.apache.tools.ant.BuildException
Execute the Perforce fstat command with file specs and options. Log the returned extended file specs.

Return a list of everything Perforce knows about a set of Perforce files.

This method is not intended for general use, and is not documented in detail here; consult the main Perforce fstat command documentation for detailed help.

This method can be a real server and bandwidth resource hog, and should be used as sparingly as possible; alternatively, try to use it with as narrow a set of file specs as possible.

Specified by:
execP4Command in class PerforceTask
Throws:
org.apache.tools.ant.BuildException - the build exception
See Also:
PerforceTask.execP4Command()


Copyright (c) 2010 Perforce Software. All rights reserved.