Package com.aspectran.core.adapter
Interface ApplicationAdapter
- All Known Implementing Classes:
AbstractApplicationAdapter
,DefaultApplicationAdapter
public interface ApplicationAdapter
The Interface ApplicationAdapter.
- Since:
- 2011. 3. 13.
-
Method Summary
Modifier and TypeMethodDescription<T> T
getAttribute
(String name) Returns the value for an attribute with the given name.Returns anEnumeration
containing the names of the attributes available to this application.Returns the base path that the current application is mapped to.void
removeAttribute
(String name) Removes an attribute set with the given name.void
setAttribute
(String name, Object value) Sets the value for the attribute of the given name, replacing an existing value (if any).toRealPath
(String filePath) Returns the real path of the existing file as a canonical pathname string.toRealPathAsFile
(String filePath) Returns the real path of an existing file.
-
Method Details
-
getBasePath
String getBasePath()Returns the base path that the current application is mapped to.- Returns:
- the base path for this application
-
toRealPath
Returns the real path of the existing file as a canonical pathname string.- Parameters:
filePath
- the relative path or classpath of the file to find- Returns:
- the canonical pathname string of the found file
- Throws:
IOException
- If there is no file corresponding to the classpath, an exception is thrown, and if it is not the classpath, no exception is thrown because theFile
instance is returned regardless of the existence of the file.
-
toRealPathAsFile
Returns the real path of an existing file.- Parameters:
filePath
- the relative path or classpath of the file to find- Returns:
- the real path of the found file
- Throws:
IOException
- If there is no file corresponding to the classpath, an exception is thrown, and if it is not the classpath, no exception is thrown because theFile
instance is returned regardless of the existence of the file.
-
getAttribute
Returns the value for an attribute with the given name.- Type Parameters:
T
- the value type- Parameters:
name
- the name of the attribute- Returns:
- the value for the attribute
-
setAttribute
Sets the value for the attribute of the given name, replacing an existing value (if any).- Parameters:
name
- the name of the attributevalue
- the value for the attribute
-
getAttributeNames
Enumeration<String> getAttributeNames()Returns anEnumeration
containing the names of the attributes available to this application.- Returns:
- the attribute names
-
removeAttribute
Removes an attribute set with the given name.- Parameters:
name
- the name of the attribute to be removed
-