Package org.metricshub.winrm
Class RemoteFileInfo
java.lang.Object
org.metricshub.winrm.RemoteFileInfo
The properties of a file or directory on the remote host, as returned by
RemoteFile.info() and RemoteDirectoryListing: an immutable value.
Timestamps come from the host's UTC file times, with their 100-nanosecond precision. The
attribute accessors decode the Windows FileAttributes bit flags; attributes()
returns the raw value for anything else (e.g. 0x800 compressed, 0x4000
encrypted).
-
Method Summary
Modifier and TypeMethodDescriptionintGet the raw WindowsFileAttributesbit flags.created()Get the creation time.booleaninthashCode()booleanTell whether the entry is marked for archiving (backup).booleanTell whether the entry is a directory.booleanisHidden()Tell whether the entry is hidden.booleanTell whether the entry is read-only.booleanTell whether the entry is a reparse point: a junction, a symbolic link, a mount point, or a cloud placeholder.booleanisSystem()Tell whether the entry is a system file or directory.Get the time of the last access.Get the time of the last write.name()Get the last element of the path: the file or directory name (C:for a drive root).path()Get the full path of the entry, as reported by the host (absolute, with backslashes).longsize()Get the size of the file.toString()
-
Method Details
-
path
Get the full path of the entry, as reported by the host (absolute, with backslashes).- Returns:
- the path
-
name
Get the last element of the path: the file or directory name (C:for a drive root).- Returns:
- the name
-
isDirectory
public boolean isDirectory()Tell whether the entry is a directory.- Returns:
truefor a directory (including a junction or a directory symbolic link)
-
size
public long size()Get the size of the file.- Returns:
- the size in bytes, 0 for a directory
-
lastModified
Get the time of the last write.- Returns:
- the last modification time
-
created
Get the creation time.- Returns:
- the creation time
-
lastAccessed
Get the time of the last access. Windows updates it lazily, or not at all when last access updates are disabled (the default on many versions): do not rely on it.- Returns:
- the last access time
-
isHidden
public boolean isHidden()Tell whether the entry is hidden.- Returns:
truewhen the hidden attribute is set
-
isSystem
public boolean isSystem()Tell whether the entry is a system file or directory.- Returns:
truewhen the system attribute is set
-
isReadOnly
public boolean isReadOnly()Tell whether the entry is read-only.- Returns:
truewhen the read-only attribute is set
-
isArchive
public boolean isArchive()Tell whether the entry is marked for archiving (backup).- Returns:
truewhen the archive attribute is set
-
isReparsePoint
public boolean isReparsePoint()Tell whether the entry is a reparse point: a junction, a symbolic link, a mount point, or a cloud placeholder. A listing reports reparse points but never descends into them.- Returns:
truewhen the reparse point attribute is set
-
attributes
public int attributes()Get the raw WindowsFileAttributesbit flags.- Returns:
- the attributes
-
equals
-
hashCode
public int hashCode() -
toString
-