ConfigLocation¶
-
public class
ConfigLocation
¶ Defines a MOTECH configuration location. If the given location starts with a leading file separator character, the location is treated as a file system directory. Otherwise, it is treated as a classpath location.
Methods¶
getFile¶
-
public File
getFile
(String fileName, FileAccessType accessType)¶ This method Returns the
java.io.File
object for the given file name relative to the config location. It also checks for the requested file accessibility. If the requested access type check isConfigLocation.FileAccessType.READABLE
, the file’s existence and readability will be checked. Similarly, if the requested access type check isConfigLocation.FileAccessType.WRITABLE
, then the write accessibility to the file will be checked. If the file does not exists, write accessibility of its ancestors will be checked.Parameters: - fileName – Name of the file to be added to the config location.
- accessType – One of
ConfigLocation.FileAccessType.READABLE
orConfigLocation.FileAccessType.WRITABLE
.
Throws: - MotechConfigurationException – if the file is not readable or writable depending on the given access type.
Returns: File relative to the config location.
getUrlResource¶
-
UrlResource
getUrlResource
()¶