Package org.opencastproject.caption.util
Class TimeUtil
java.lang.Object
org.opencastproject.caption.util.TimeUtil
Auxiliary class that contains methods for converting from and to specific time formats.
-
Method Summary
Modifier and TypeMethodDescriptionstatic StringexportToDFXP(org.opencastproject.caption.api.Time time) ExportsTimeinstance to the DFXP time format representation.static StringexportToSrt(org.opencastproject.caption.api.Time time) ExportsTimeinstance to the SubRip time format representation.static StringexportToVtt(org.opencastproject.caption.api.Time time) ExportsTimeinstance to the WebVTT time format representation.static org.opencastproject.caption.api.TimeimportDFXP(String timeDfxp) Parse String representation of DFXP time format.static org.opencastproject.caption.api.TimeParse String representation of SubRip time format.
-
Method Details
-
importSrt
public static org.opencastproject.caption.api.Time importSrt(String timeSrt) throws org.opencastproject.caption.api.IllegalTimeFormatException Parse String representation of SubRip time format.- Parameters:
timeSrt- SubRip time format- Returns:
- parsed
Timeinstance - Throws:
org.opencastproject.caption.api.IllegalTimeFormatException- if argument is not SubRip time format
-
exportToSrt
ExportsTimeinstance to the SubRip time format representation.- Parameters:
time-Timeinstance to be exported- Returns:
- time exported to SubRip time format
-
exportToVtt
ExportsTimeinstance to the WebVTT time format representation.- Parameters:
time-Timeinstance to be exported- Returns:
- time exported to WebVTT time format
-
importDFXP
public static org.opencastproject.caption.api.Time importDFXP(String timeDfxp) throws org.opencastproject.caption.api.IllegalTimeFormatException Parse String representation of DFXP time format. It does not support parsing of metrics (for example: 34.567s).- Parameters:
timeDfxp- DFXP time format- Returns:
- parsed
Timeinstance - Throws:
org.opencastproject.caption.api.IllegalTimeFormatException- if argument is not DFXP time format or is not supported.
-
exportToDFXP
ExportsTimeinstance to the DFXP time format representation. Specifically time format used is 0:00:00.000- Parameters:
time-Timeinstance to be exported- Returns:
- time exported to DFXP time format
-