org.rhq.core.util.file
Class GenericContentFileInfo
java.lang.Object
org.rhq.core.util.file.ContentFileInfo
org.rhq.core.util.file.GenericContentFileInfo
public class GenericContentFileInfo
- extends ContentFileInfo
Handles any generic file. This is to be used as a fallback if no other
more specific ContentFileInfo implementation exists to handle a specific file.
- Author:
- John Mazzitelli
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
GenericContentFileInfo
public GenericContentFileInfo(File file)
isValid
public boolean isValid()
- Any file is considered valid if it exists and is readable.
- Specified by:
isValid in class ContentFileInfo
- Returns:
true iff the file exists and is readable
getVersion
public String getVersion(String defaultValue)
- If the caller provided a default value, it is used. If the default
value is
null, this will generate a version string
equal to the file's MD5 hashcode. If this fails to calculate the
MD5, a runtime exception is thrown.
- Specified by:
getVersion in class ContentFileInfo
- Parameters:
defaultValue - the string to return, unless this is null
- Returns:
- the default value if not
null, otherwise, the MD5 of the file
getDescription
public String getDescription(String defaultValue)
- This method simply returns the default value. There is no description
for a generic file that this method can return.
- Specified by:
getDescription in class ContentFileInfo
- Parameters:
defaultValue - the value that will be returned
- Returns:
- simply returns the default value
Copyright © 2008-2012 Red Hat, Inc.. All Rights Reserved.