Package org.ametys.core.util.path
Class PathTimeStampValidity
java.lang.Object
org.ametys.core.util.path.PathTimeStampValidity
- All Implemented Interfaces:
Serializable
,SourceValidity
- Direct Known Subclasses:
SkinTimeStampValidity
A validation object for time-stamps.
- See Also:
-
Field Summary
Fields inherited from interface org.apache.excalibur.source.SourceValidity
INVALID, UNKNOWN, UNKNWON, VALID
-
Constructor Summary
ModifierConstructorDescriptionprotected
Empty constructor for sub classes only.PathTimeStampValidity
(String filename) Creates from a namePathTimeStampValidity
(Path file) Creates from a filePathTimeStampValidity
(Path file, long timeStamp) Creates from a file -
Method Summary
Modifier and TypeMethodDescriptionprotected static Path
Get file from an absolute pathprotected static long
_getTimeStamp
(Path file) Get the timestamp from a filegetFile()
Get the filelong
Get the timestampint
isValid()
int
isValid
(SourceValidity newValidity) toString()
-
Field Details
-
_timeStamp
The timestamp
-
-
Constructor Details
-
PathTimeStampValidity
Creates from a name- Parameters:
filename
- File name
-
PathTimeStampValidity
Creates from a file- Parameters:
file
- file wrapped
-
PathTimeStampValidity
Creates from a file- Parameters:
file
- file wrappedtimeStamp
- file timestamp
-
PathTimeStampValidity
protected PathTimeStampValidity()Empty constructor for sub classes only.
-
-
Method Details
-
_getTimeStamp
Get the timestamp from a file- Parameters:
file
- the file- Returns:
- the file's timestamp
-
isValid
- Specified by:
isValid
in interfaceSourceValidity
-
isValid
- Specified by:
isValid
in interfaceSourceValidity
-
getFile
Get the file- Returns:
- the file
-
_getFile
Get file from an absolute path- Parameters:
absolutePath
- the absolute path- Returns:
- the file
-
getTimeStamp
Get the timestamp- Returns:
- the timestamp or -1 if it cannot be computed
-
toString
-