Class AbstractDeployable
- java.lang.Object
-
- org.codehaus.cargo.util.log.LoggedObject
-
- org.codehaus.cargo.container.spi.deployable.AbstractDeployable
-
- All Implemented Interfaces:
Deployable
,Loggable
public abstract class AbstractDeployable extends LoggedObject implements Deployable
Common class for easy Deployable implementations.
-
-
Constructor Summary
Constructors Constructor Description AbstractDeployable(String file)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object object)
String
getFile()
FileHandler
getFileHandler()
String
getFilename()
Deployable file name, taking into account theDeployable.getName()
, including any deployable-specific aspects of it, and the escaping in order to avoid unwanted file system actions (for example, ensuring the file name contains no slashes).String
getName()
Returns the name of this deployable.DeployableVersion
getVersion()
int
hashCode()
boolean
isExpanded()
void
setFileHandler(FileHandler fileHandler)
void
setLogger(Logger logger)
Overriden in order to set the logger on ancillary components.void
setVersion(DeployableVersion version)
String
toString()
-
Methods inherited from class org.codehaus.cargo.util.log.LoggedObject
getLogger
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.codehaus.cargo.container.deployable.Deployable
getType
-
-
-
-
Constructor Detail
-
AbstractDeployable
public AbstractDeployable(String file)
- Parameters:
file
- the location of the deployable file being wrapped.
-
-
Method Detail
-
getFile
public String getFile()
- Specified by:
getFile
in interfaceDeployable
- Returns:
- the file representing the archive to deploy
-
getVersion
public DeployableVersion getVersion()
- Specified by:
getVersion
in interfaceDeployable
- Returns:
- the deployable's version (j2ee, javaee, jakartaee, etc)
-
setVersion
public void setVersion(DeployableVersion version)
- Parameters:
version
- Deployable's version (j2ee, javaee, jakartaee, etc)
-
getFileHandler
public FileHandler getFileHandler()
- Returns:
- the Cargo file utility class
-
setFileHandler
public void setFileHandler(FileHandler fileHandler)
- Parameters:
fileHandler
- the Cargo file utility class to use. This method is useful for unit testing with Mock objects as it can be passed a test file handler that doesn't perform any real file action.
-
setLogger
public void setLogger(Logger logger)
Overriden in order to set the logger on ancillary components.- Specified by:
setLogger
in interfaceLoggable
- Overrides:
setLogger
in classLoggedObject
- Parameters:
logger
- the logger to set and set in the ancillary objects
-
isExpanded
public boolean isExpanded()
- Specified by:
isExpanded
in interfaceDeployable
- Returns:
- If the deployable is a directory or not
-
getName
public String getName()
Returns the name of this deployable. Default value is computed from the Deployable file name (removing the filename extension).- Specified by:
getName
in interfaceDeployable
- Returns:
- the name of this deployable
-
getFilename
public String getFilename()
Deployable file name, taking into account theDeployable.getName()
, including any deployable-specific aspects of it, and the escaping in order to avoid unwanted file system actions (for example, ensuring the file name contains no slashes).
Default value is the Deployable file name.- Specified by:
getFilename
in interfaceDeployable
- Returns:
- The file or directory name for this deployable.
-
-