Perforce

com.perforce.api
Class DirEntry

java.lang.Object
  |
  +--com.perforce.api.SourceControlObject
        |
        +--com.perforce.api.DirEntry
All Implemented Interfaces:
Cacheable

public final class DirEntry
extends SourceControlObject

Representation of a source control directory.

Version:
$Date: 2002/08/05 $ $Revision: #6 $
Author:
David Markley

Constructor Summary
DirEntry()
          Default, no-argument constructor.
DirEntry(DirEntry base, String path)
          Constructs a directory entry.
DirEntry(Env e)
          Constructs a directory entry.
DirEntry(Env e, String path)
          Constructs a directory entry.
 
Method Summary
 void commit()
          Does nothing.
 String getBasePath()
          Returns the base path for this directory.
 HashDecay getCache()
          Returns the HashDecay instance for this class
static DirEntry getDirEntry(Env env, String path, boolean sync)
          Returns a directory entry for the supplied path.
 String[] getDirNames()
          Returns an array of directory names.
 String[] getDirNames(Env env)
          Returns an array of directory names.
 String[] getFileNames()
          Returns an array of file names for this directory.
 String[] getFileNames(Env env)
          Returns an array of file names for this directory.
 FileEntry[] getFiles()
          Returns an array of file entries for this directory.
 FileEntry[] getFiles(Env env)
          Returns an array of file entries for this directory.
 DirEntry getParent()
          Returns the parent director.
 String getPath()
          Returns the path for this directory.
 void setPath(String path)
          Sets the path for this directory.
 void sync()
          Loads the directories and files for this directory.
 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, toString, wait, wait, wait
 

Constructor Detail

DirEntry

public DirEntry()
Default, no-argument constructor.

DirEntry

public DirEntry(DirEntry base,
                String path)
Constructs a directory entry.
Parameters:
base - Another DirEntry used to set the environment.
path - The path for this directory.

DirEntry

public DirEntry(Env e)
Constructs a directory entry.
Parameters:
e - Source control environment to use.

DirEntry

public DirEntry(Env e,
                String path)
Constructs a directory entry.
Parameters:
e - Source control environment to use.
path - The path for this directory.
Method Detail

commit

public void commit()
Does nothing. Doesn't do anything here, since directories are not really stored in perforce.
Overrides:
commit in class SourceControlObject

getBasePath

public String getBasePath()
Returns the base path for this directory. This includes everything up to the last path delimeter.

getCache

public HashDecay getCache()
Description copied from class: SourceControlObject
Returns the HashDecay instance for this class
Overrides:
getCache in class SourceControlObject

getDirEntry

public static DirEntry getDirEntry(Env env,
                                   String path,
                                   boolean sync)
Returns a directory entry for the supplied path.
Parameters:
env - Source control environment to use.
path - The path for this directory.
sync - Forces the directory information to be current.

getDirNames

public String[] getDirNames()
Returns an array of directory names.

getDirNames

public String[] getDirNames(Env env)
Returns an array of directory names.
Parameters:
env - Source control environment to use.

getFileNames

public String[] getFileNames()
Returns an array of file names for this directory.

getFileNames

public String[] getFileNames(Env env)
Returns an array of file names for this directory.
Parameters:
env - Source control environment to use.

getFiles

public FileEntry[] getFiles()
Returns an array of file entries for this directory.

getFiles

public FileEntry[] getFiles(Env env)
Returns an array of file entries for this directory.
Parameters:
env - Source control environment to use.

getParent

public DirEntry getParent()
Returns the parent director. Constructs a new DirEntry that represents the parent and returns it.

getPath

public String getPath()
Returns the path for this directory.

setPath

public void setPath(String path)
Sets the path for this directory.
Parameters:
path - New path for this directory.

sync

public void sync()
Loads the directories and files for this directory.
Overrides:
sync in class SourceControlObject

toXML

public String toXML()
Description copied from class: SourceControlObject
Returns a string containing the object in XML form.
Overrides:
toXML in class SourceControlObject

Perforce

Copyright © 2001, Perforce Software, All rights reserved.