Class ScpTimestampCommandDetails
- java.lang.Object
-
- org.apache.sshd.scp.common.helpers.AbstractScpCommandDetails
-
- org.apache.sshd.scp.common.helpers.ScpTimestampCommandDetails
-
public class ScpTimestampCommandDetails extends AbstractScpCommandDetails
Represents an SCP timestamp definition
-
-
Field Summary
Fields Modifier and Type Field Description static charCOMMAND_NAMEprivate longlastAccessTimeprivate longlastModifiedTime-
Fields inherited from class org.apache.sshd.scp.common.helpers.AbstractScpCommandDetails
command
-
-
Constructor Summary
Constructors Constructor Description ScpTimestampCommandDetails(long modTime, long accTime)ScpTimestampCommandDetails(java.lang.String header)ScpTimestampCommandDetails(java.nio.file.attribute.FileTime modTime, java.nio.file.attribute.FileTime accTime)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object obj)longgetLastAccessTime()longgetLastModifiedTime()inthashCode()static ScpTimestampCommandDetailsparse(java.lang.String line)java.lang.StringtoHeader()java.lang.StringtoString()-
Methods inherited from class org.apache.sshd.scp.common.helpers.AbstractScpCommandDetails
getCommand
-
-
-
-
Field Detail
-
COMMAND_NAME
public static final char COMMAND_NAME
- See Also:
- Constant Field Values
-
lastModifiedTime
private final long lastModifiedTime
-
lastAccessTime
private final long lastAccessTime
-
-
Constructor Detail
-
ScpTimestampCommandDetails
public ScpTimestampCommandDetails(java.lang.String header)
-
ScpTimestampCommandDetails
public ScpTimestampCommandDetails(java.nio.file.attribute.FileTime modTime, java.nio.file.attribute.FileTime accTime)
-
ScpTimestampCommandDetails
public ScpTimestampCommandDetails(long modTime, long accTime)
-
-
Method Detail
-
getLastModifiedTime
public long getLastModifiedTime()
-
getLastAccessTime
public long getLastAccessTime()
-
toHeader
public java.lang.String toHeader()
- Specified by:
toHeaderin classAbstractScpCommandDetails- Returns:
- The equivalent SCP command header represented by these details
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
parse
public static ScpTimestampCommandDetails parse(java.lang.String line) throws java.lang.NumberFormatException
- Parameters:
line- The time specification - format:T<mtime-sec> <mtime-micros> <atime-sec> <atime-micros>where specified times are in seconds since UTC - ignored ifnull- Returns:
- The
ScpTimestampCommandDetailsvalue with the timestamps converted to milliseconds - Throws:
java.lang.NumberFormatException- if bad numerical values - Note: validates that 1st character is 'T'.- See Also:
- How the SCP protocol works
-
-