Class AbstractDeployablewithSettableName
- java.lang.Object
-
- org.codehaus.cargo.util.log.LoggedObject
-
- org.codehaus.cargo.container.spi.deployable.AbstractDeployable
-
- org.codehaus.cargo.container.spi.deployable.AbstractDeployablewithSettableName
-
- All Implemented Interfaces:
Deployable
,Loggable
public abstract class AbstractDeployablewithSettableName extends AbstractDeployable
Common class for easy Deployable implementations with settable names.
-
-
Constructor Summary
Constructors Constructor Description AbstractDeployablewithSettableName(String file)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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.void
setName(String name)
Sets the name of this deployable.-
Methods inherited from class org.codehaus.cargo.container.spi.deployable.AbstractDeployable
equals, getFile, getFileHandler, getVersion, hashCode, isExpanded, setFileHandler, setLogger, setVersion, 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
-
AbstractDeployablewithSettableName
public AbstractDeployablewithSettableName(String file)
- Parameters:
file
- the location of the deployable file being wrapped.
-
-
Method Detail
-
setName
public void setName(String name)
Sets the name of this deployable. It can be anything (there's no special rule), exceptnull
or an empty string.- Parameters:
name
- the name of this deployable
-
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
- Overrides:
getName
in classAbstractDeployable
- 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.
Default value is the Deployable sanitizedgetName()
with the deployable type as extension.- Specified by:
getFilename
in interfaceDeployable
- Overrides:
getFilename
in classAbstractDeployable
- Returns:
- The file or directory name for this deployable.
-
-