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 booleanequals(Object object)StringgetFile()FileHandlergetFileHandler()StringgetFilename()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).StringgetName()Returns the name of this deployable.DeployableVersiongetVersion()inthashCode()booleanisExpanded()voidsetFileHandler(FileHandler fileHandler)voidsetLogger(Logger logger)Overriden in order to set the logger on ancillary components.voidsetVersion(DeployableVersion version)StringtoString()-
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:
getFilein interfaceDeployable- Returns:
- the file representing the archive to deploy
-
getVersion
public DeployableVersion getVersion()
- Specified by:
getVersionin 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:
setLoggerin interfaceLoggable- Overrides:
setLoggerin classLoggedObject- Parameters:
logger- the logger to set and set in the ancillary objects
-
isExpanded
public boolean isExpanded()
- Specified by:
isExpandedin 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:
getNamein 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:
getFilenamein interfaceDeployable- Returns:
- The file or directory name for this deployable.
-
-