|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sourceforge.argval.utils.impl.PropertyLocatedFile
public class PropertyLocatedFile
This LocateFile implementation provides a way for locating an file, based on a property, or based on a default name in the current working directory, or based on a default application (configuration) directory (which contains file, with the default name). The file is located as follows:
property-key-name-configuration-file
is set, that
file is returned.
Constructor Summary | |
---|---|
PropertyLocatedFile(String propKeyNameFile,
String configDirName,
String defaultFileName,
org.slf4j.Logger logger)
Creates a LocateFile specific for an application / utility. |
Method Summary | |
---|---|
File |
getFile()
Returns the File instance. |
String |
getFileMessage()
Returns a message about how the file was located. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PropertyLocatedFile(String propKeyNameFile, String configDirName, String defaultFileName, org.slf4j.Logger logger)
LocateFile
specific for an application / utility.
Specify the propKeyNameFile
as a property key. This key can be used
to specify the location of the file to locate, as system property / environment variable.
As in:
java -Dmy-application-name.configuration.path=Theorg.organisation.application.Start
folderName
is optional, use it when the application has a default configuration folder
in the users home directory. Like ${user.home/.my-application-config/
.
The defaultFileName
required, used to find load the default configuration file, from the
configuration application configuration directory
(${user.home}/.my-application-config/defaultFileName
). Or the current working directory
(${user.dir}/defaultFileName
).
propKeyNameFile
- - the system property key, for locating the configuration file (not null
)configDirName
- - the applications configuration directory (when it has one) (can be null
)defaultFileName
- - the default configuration file name (not null
).logger
- - the logging instance (not null
)Method Detail |
---|
public File getFile() throws FileNotFoundException
LocateFile
getFile
in interface LocateFile
FileNotFoundException
- Is thrown in the case the file is not found.public String getFileMessage()
LocateFile
getFileMessage
in interface LocateFile
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |