Class FTPFileInfo

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.

Deprecated:

The FTPClient is deprecated. Use SFTPClient for a secure alternative.

Warning

Property Summary 

PropertyDescription
directory: Boolean (read-only)Identifies if the file is a directory.
name: String (read-only)Returns the name of the file.
size: Number (read-only)Returns the size of the file.
timestamp: Date (read-only)Returns the timestamp of the file.

Constructor Summary 

ConstructorDescription
FTPFileInfo(String, Number, Boolean, Date)Constructs the FTPFileInfo instance.

Method Summary 

MethodDescription
getDirectory()Identifies if the file is a directory.
getName()Returns the name of the file.
getSize()Returns the size of the file.
getTimestamp()Returns the timestamp of the file.

Methods inherited from class Object 

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

Property Details 

directory 

directory: Boolean (read-only)

Identifies if the file is a directory.


name 

name: String (read-only)

Returns the name of the file.


size 

size: Number (read-only)

Returns the size of the file.


timestamp 

timestamp: Date (read-only)

Returns the timestamp of the file.


Constructor Details 

FTPFileInfo(String, Number, Boolean, Date) 

FTPFileInfo(name: String, size: Number, directory: Boolean, timestamp: Date)

Constructs the FTPFileInfo instance.

Parameters:

  • name - the name of the file.
  • size - the size of the file.
  • directory - controls if the file is a directory.
  • timestamp - the timestamp of the file.

Method Details 

getDirectory() 

getDirectory(): Boolean

Identifies if the file is a directory.

Returns:

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

getName() 

getName(): String

Returns the name of the file.

Returns:

  • the name of the file.

getSize() 

getSize(): Number

Returns the size of the file.

Returns:

  • the size of the file.

getTimestamp() 

getTimestamp(): Date

Returns the timestamp of the file.

Returns:

  • the timestamp of the file.