|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.schmant.support.AbstractArgumentChecker org.schmant.support.FutureEntity org.schmant.support.FutureDirectory
public class FutureDirectory
This object is a FutureEntity
for future entities that are
directories. Using it in build scripts gives a more readable script and a
little bit of error checking.
This object should be used mostly by build scripts. Consumers of future
entity objects, such as tasks, should use FutureEntity
objects.
Constructor Summary | |
---|---|
FutureDirectory(DirectoryView dir)
Create a future directory representing an existing directory entity. |
|
FutureDirectory(DirectoryView base,
RelativeLocation loc)
Create a new future directory with a relative location against a base directory. |
|
FutureDirectory(DirectoryView parentDir,
String name)
Create a new future directory with a name and a parent directory. |
|
FutureDirectory(File dir)
Create a future directory representing the referenced directory of a File object. |
Method Summary | |
---|---|
DirectoryView |
getEntity()
Get the directory, creating it if necessary. |
DirectoryView |
getEntityOrNull()
Get the directory, returning null if it does not exist. |
EFile |
getFile()
Get the file referenced by this future entity, possibly creating it if it does not already exist. |
File |
getFileObject()
Get a File object referencing the directory. |
boolean |
isExistingDirectory()
Is this future directory referencing an existing directory. |
boolean |
isExistingFile()
This method returns false . |
String |
toString()
|
Methods inherited from class org.schmant.support.FutureEntity |
---|
exists, getBaseDirectory, getDirectory, getLocation, getName, getParent, getParentOrNull, getRelativeLocation |
Methods inherited from class org.schmant.support.AbstractArgumentChecker |
---|
check, check, check, check |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public FutureDirectory(DirectoryView parentDir, String name)
This may reference a directory that already exists.
parentDir
- The parent directory.name
- public FutureDirectory(DirectoryView base, RelativeLocation loc)
This may reference a directory that already exists.
base
- The base directory.loc
- The relative location of the directory against the base
directory.public FutureDirectory(DirectoryView dir)
dir
- The directory.public FutureDirectory(File dir)
File
object. The directory may already exist.
dir
- The directory.Method Detail |
---|
public DirectoryView getEntity() throws NotADirectoryException
getEntity
in class FutureEntity
NotADirectoryException
- If the entity at the referenced location
is not a directory.public DirectoryView getEntityOrNull() throws NotADirectoryException
null
if it does not exist.
getEntityOrNull
in class FutureEntity
null
.
NotADirectoryException
- If the entity at the referenced location
is not a directory.public boolean isExistingDirectory() throws NotADirectoryException
isExistingDirectory
in class FutureEntity
true
if this object references an existing directory.
NotADirectoryException
- If the entity at the referenced location
is not a directory.public boolean isExistingFile() throws NotADirectoryException
false
.
isExistingFile
in class FutureEntity
true
if this future entity references an already existing
file.
NotAFileException
- If the entity at the referenced location is not
a directory.
NotADirectoryException
public File getFileObject() throws NotADirectoryException
File
object referencing the directory. The directory may or
may not exist.
getFileObject
in class FutureEntity
File
referencing the future entity's location.
NotADirectoryException
- If the entity at the referenced location
is not a directory.public EFile getFile() throws UnsupportedOperationException
FutureEntity
getFile
in class FutureEntity
UnsupportedOperationException
- Always!FutureEntity.getDirectory()
public String toString()
toString
in class FutureEntity
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |