Class SFTPFileInfo

The class is used to store information about a remote file.

Note: when this class is used with sensitive data, be careful in persisting sensitive information to disk.

PropertyDescription
directory: Boolean (read-only)Identifies if the file is a directory.
modificationTime: Date (read-only)Returns the last modification time of the file/directory.
name: String (read-only)Returns the name of the file/directory.
size: Number (read-only)Returns the size of the file/directory.
ConstructorDescription
SFTPFileInfo(String, Number, Boolean, Number)Constructs the SFTPFileInfo instance.
MethodDescription
getDirectory()Identifies if the file is a directory.
getModificationTime()Returns the last modification time of the file/directory.
getName()Returns the name of the file/directory.
getSize()Returns the size of the file/directory.

assign, create, create, defineProperties, defineProperty, entries, freeze, fromEntries, getOwnPropertyDescriptor, getOwnPropertyNames, getOwnPropertySymbols, getPrototypeOf, hasOwnProperty, is, isExtensible, isFrozen, isPrototypeOf, isSealed, keys, preventExtensions, propertyIsEnumerable, seal, setPrototypeOf, toLocaleString, toString, valueOf, values

directory: Boolean (read-only)

Identifies if the file is a directory.


modificationTime: Date (read-only)

Returns the last modification time of the file/directory.


name: String (read-only)

Returns the name of the file/directory.


size: Number (read-only)

Returns the size of the file/directory.


SFTPFileInfo(name: String, size: Number, directory: Boolean, mtime: Number)

Constructs the SFTPFileInfo instance.

Parameters:

  • name - the name of the file.
  • size - the size of the file.
  • directory - controls if the file is a directory.
  • mtime - last modification time.

getDirectory(): Boolean

Identifies if the file is a directory.

Returns:

  • true if the file is a directory, false otherwise.

getModificationTime(): Date

Returns the last modification time of the file/directory.

Returns:

  • the last modification time.

getName(): String

Returns the name of the file/directory.

Returns:

  • the name.

getSize(): Number

Returns the size of the file/directory.

Returns:

  • the size.