|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.schmant.support.AbstractArgumentChecker
org.schmant.support.FutureEntity
org.schmant.support.FutureFile
public class FutureFile
This object is a FutureEntity
for future entities that are files.
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 | |
---|---|
FutureFile(DirectoryView base,
RelativeLocation loc)
Create a new future file with a relative location against a base directory. |
|
FutureFile(DirectoryView parentDir,
String name)
Create a new future file with a name and a parent directory. |
|
FutureFile(EFile f)
Create a future file representing an existing file entity. |
|
FutureFile(File f)
Create a future file representing the referenced file of a File
object. |
Method Summary | |
---|---|
DirectoryView |
getDirectory()
Get the directory referenced by this future entity, possibly creating it if it does not already exist. |
EFile |
getEntity()
Get the file, creating it if necessary. |
EFile |
getEntityOrNull()
Get the file, returning null if it does not exist. |
File |
getFileObject()
Get a File object referencing the file. |
boolean |
isExistingDirectory()
This method returns false . |
boolean |
isExistingFile()
This method returns true if this future file references an
existing file. |
String |
toString()
|
Methods inherited from class org.schmant.support.FutureEntity |
---|
exists, getBaseDirectory, getFile, 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 FutureFile(DirectoryView parentDir, String name)
This may reference a file that already exists.
parentDir
- The parent directory.name
- public FutureFile(DirectoryView base, RelativeLocation loc)
This may reference a file that already exists.
base
- The base directory.loc
- The relative location of the file against the directory.public FutureFile(EFile f)
f
- The file.public FutureFile(File f)
File
object. The file may already exist.
f
- The file.Method Detail |
---|
public EFile getEntity() throws NotAFileException
getEntity
in class FutureEntity
NotAFileException
- If the entity at the referenced location is not
a file.public EFile getEntityOrNull() throws NotAFileException
null
if it does not exist.
getEntityOrNull
in class FutureEntity
null
.
NotAFileException
- If the entity at the referenced location is not
a file.public boolean isExistingDirectory() throws NotAFileException
false
.
isExistingDirectory
in class FutureEntity
true
if this future entity references an already existing
directory.
NotAFileException
- If the entity at the referenced location is not
a file.public boolean isExistingFile() throws NotAFileException
true
if this future file references an
existing file.
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 file.public File getFileObject() throws NotAFileException
File
object referencing the file. The file may or may not
exist.
getFileObject
in class FutureEntity
File
referencing the future entity's location.
NotAFileException
- If the entity at the referenced location is not
a file.public DirectoryView getDirectory() throws UnsupportedOperationException
FutureEntity
getDirectory
in class FutureEntity
UnsupportedOperationException
- Always!FutureEntity.getFile()
public String toString()
toString
in class FutureEntity
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |