B2Win Suite Documentation (Under Construction)
ContactB2Data
5.6
5.6
  • B2Win Suite Documentation
  • Scripting
    • B2Win Suite Scripting Overview
    • Scripting in B2Data
      • Custom Script Nodes
        • Custom Script
        • Source Script Node (File)
        • Source Script Node (Table)
        • Source Script Node (Object)
        • If-Else Condition
        • Switch case
        • Condition Node
      • In DataPrep
      • Properties
      • Workflow Applications
        • Workflow #1
        • Workflow #2
    • Getting Started
    • Language Basics
    • Types & Objects
      • Primitives
      • Objects
        • Instant
        • LocalDateTime
        • LocalDate
        • LocalTime
        • JsonNode
        • ObjectNode
        • File
        • SuiteTable
        • Duration
        • Period
      • Arrays & Maps
      • Row, Column, StringColumn
    • Utilities
      • Date & Time
        • InstantUtil
        • GeneralDateUtil
        • LocalDateTimeUtil
        • LocalDateUtil
        • LocalTimeUtil
        • Formatting
        • Timezones
      • Math
      • StrictMath
      • NumericUtil
      • DbUtil
      • DbExecutor
      • StateUtil
      • FileUtil
      • JsonUtil
      • HttpUtil
      • NodeInputReader
      • RandomUtil
      • HashingUtil
      • ShellUtil
      • CompressionUtil
      • Logging
    • Properties
    • Context and System
      • Context
      • System
    • Configurations
      • Workflow Configuration
    • Tutorial
    • Feedback
  • B2Data
    • Tutorials
      • Infor DataFabric to On-Premise Database Replication
      • API (DB replication, Email)
    • Workflow Settings
      • General Settings
      • Global/All Properties
      • Execution Configuration
        • General
        • Runtime
        • Compiler
        • Storage
        • Clean Up
      • Permissions
    • Nodes
      • Scheduler
    • Services Configuration
      • Microsoft Graph
Powered by GitBook
On this page
  • Constructor
  • Methods

Was this helpful?

  1. Scripting
  2. Types & Objects
  3. Objects

File

The File class is designed to handle file-related operations, providing methods for managing file properties and interactions.

Constructor

constructor(filePath: String)

Creates an instance of the File class representing a specific file path.

  • filePath (String): The file path for which the File instance is created.

Methods

  • getAbsolutePath(): String

Retrieves the absolute path of the file, including the file's name.

var absolutePath = file.getAbsolutePath();
  • exists(): Boolean

Checks if the file exists and returns true if it exists, otherwise false.

var fileExists = file.exists();
  • isFile(): Boolean

Determines whether the object represents a file (as opposed to a directory) and returns true for a file, false otherwise.

var isFile = file.isFile();
  • isDirectory(): Boolean

Determines whether the object represents a directory and returns true for a directory, false otherwise.

var isDirectory = file.isDirectory();
  • lastModified(): Long

Gets the timestamp indicating the last modification time of the file, typically in milliseconds since the epoch. The return type is "Long."

var lastModified = file.lastModified();
  • delete(): Boolean

Attempts to delete the file and returns true if the deletion was successful, and false if it failed.

var deletionSuccessful = file.delete();
  • getName(): String

Retrieves the name of the file (without the path) as a string.

var fileName = file.getName();
  • getParent(): String

Gets the parent directory's path as a string.

var parentDirectory = file.getParent();
  • getParentFile(): File

Returns a new File object representing the parent directory of the current file.

var parentDirectoryFile = file.getParentFile();
  • getPath(): String

Retrieves the path of the file (including its name) as a string.

var filePathString = file.getPath();
PreviousObjectNodeNextSuiteTable

Was this helpful?

For a more comprehensive overview, you can explore the class to delve into the full range of available methods.

FileUtil