JsDoc Reference - File

Class Index | File Index

## Classes

- _global_
- AccessController
- APDU
- AuthenticationObject
- CAConnection
- ChipAuthentication
- ChipAuthenticationDomainParameterInfo
- ChipAuthenticationInfo
- ChipAuthenticationPublicKeyInfo
- CommandInterpreter
- CRLGenerator
- CVC
- CVCCA
- CVCertificateStore
- DataUnitAPDU
- DF
- DKEK
- DNEncoder
- EAC20
- EAC2CVCertificateGenerator
- EAC2CVRequestGenerator
- FCP
- File
- FileEncryptor
- FileSelector
- FileSystemIdObject
- FSNode
- GPSCP03
- HSMCVCertificateStore
- HSMKeyStore
- LinearEF
- ManagePKA
- P11CVCertificateStore
- PACE
- PACEDomainParameterInfo
- PACEInfo
- PaperKeyEncoding
- PKCS10Generator
- PublicKeyFile
- PublicKeyReference
- RAMClient
- RestrictedIdentificationDomainParameterInfo
- RestrictedIdentificationInfo
- SecureChannelHandler
- SecureMessagingCommandAPDUDecoder
- SecurityEnvironment
- SignatureKey
- SmartCardHSM
- SmartCardHSMCrypto
- SmartCardHSMInitializer
- SmartCardHSMKey
- SmartCardHSMKeySpecGenerator
- SmartCardHSMSymmetricKeySpecGenerator
- TransparentEF
- TrustAnchor
- X509CertificateGenerator
- X509CertificateIssuer
- X509CertificateStore
- X509Signer

# Class File

Class implementing basic support for files
Defined in: File.js.

Class Summary
Constructor Attributes | Constructor Name and Description
--- | ---
| File(name, location) Create a reference to a file system object (file or directory)

Method Summary
Method Attributes | Method Name and Description
--- | ---
| close() Close streams associated with file
| exists() Return true if file exists
| getAbsolutePath(mode) Return absolute path
| getParentFile() Return the parent file of this file object
| list() Return list of files contained in the directory referenced by the File object
| readAllAsBinary() Read complete file into ByteString object
| readAllAsString(encoding) Read complete file into String object
| writeAll(obj, encoding) Write the object to file

Class Detail
File(name, location)
Create a reference to a file system object (file or directory)

Parameters:
{String} name
  relative or absolute file path
{Number} location
  one of GPSystem.CWD, GPSystem.USR, GPSystem.SYS, GPSystem.AUTO to resolve relative names. Default GPSystem.CWD

Method Detail
close()
Close streams associated with file

exists()
Return true if file exists

{String} getAbsolutePath(mode)
Return absolute path

Parameters:
mode

Returns:
  the absolute path

{File} getParentFile()
Return the parent file of this file object

Returns:
  the parent file object or null

{String[]} list()
Return list of files contained in the directory referenced by the File object

Returns:
  the list of file names

{ByteString} readAllAsBinary()
Read complete file into ByteString object

Returns:
  the binary content

{String} readAllAsString(encoding)
Read complete file into String object

Parameters:
encoding

Returns:
  the text content

writeAll(obj, encoding)
Write the object to file

Parameters:
obj
encoding

Documentation generated by JsDoc Toolkit 2.4.0 on Wed Mar 18 2026 21:29:18 GMT+0100 (CET)