servoy sReturnTypes2100%height: 30px;2Supported ClientssWordListSmartClientsWordListWebClientsWordListNGClientservoy sSummary12%30%58%height: 30px;3Methods SummaryReturns true if the file exists and is readable (has access to it) - works on remote files too.Returns true if the file exists and can be modified - works on remote files too.Creates the file on disk if needed.Deletes the file from the disk if possible.Returns true if the file/directory exists on the filesystem - works on remote files too.Returns a JSFile instance that corresponds to the absolute form of this pathname - works on remote files too.Returns a String representation of the absolute form of this pathname - works on remote files too.Gets the contents (bytes) for the file data.Returns the contenttype of this file, like for example 'application/pdf' - works on remote files too.Returns the name of the file.Returns the String representation of the path of the parent of this file - works on remote files too.Returns a JSFile instance that corresponds to the parent of this file - works on remote files too.Returns a String holding the path to the file - works on remote files too.Returns true if the path is absolute.Returns true if the file is a directory - works on remote files too.Returns true if the file is a file and not a regular file - works on remote files too.Returns true if the file is hidden (a file system attribute) - works on remote files too.Returns the time/date of the last modification on the file - works on remote files too.Returns an array of strings naming the files and directories located inside the file, if the file is a directory - works on remote files too.Returns an array of JSFiles naming the files and directories located inside the file, if the file is a directory - works on remote files too.Creates a directory on disk if possible.Creates a directory on disk, together with all its parent directories, if possible.Renames the file to a different name.Set the content of the file (local or remote) to the bytes provided<br/> Will not create a new file if one doesn't existSet the content of the file (local or remote) to the bytes providedSets the date/time of the last modification on the file.Sets the readonly attribute of the file/directory.Returns the size in bytes of the file.functionservoy sDetail2100%height:30px2Methods DetailscanReadname
canRead()
dessIndent
Returns true if the file exists and is readable (has access to it) - works on remote files too.
ret
Returns
sIndentclients
Supported Clients
sIndentSmartClient,WebClient,NGClientsam
Sample
sIdentjavascriptlastDetailRowcanWritename
canWrite()
dessIndent
Returns true if the file exists and can be modified - works on remote files too.
ret
Returns
sIndentclients
Supported Clients
sIndentSmartClient,WebClient,NGClientsam
Sample
sIdentjavascriptlastDetailRowcreateNewFilename
createNewFile()
dessIndent
Creates the file on disk if needed. Returns true if the file (name) did not already exists and had to be created - for remote, use the streamFilesToServer to stream a file.
ret
Returns
sIndentclients
Supported Clients
sIndentSmartClient,WebClient,NGClientsam
Sample
sIdentjavascriptlastDetailRowdeleteFilename
deleteFile()
dessIndent
Deletes the file from the disk if possible. Returns true if the file could be deleted. If the file is a directory, then it must be empty in order to be deleted - works on remote files too.
ret
Returns
sIndentclients
Supported Clients
sIndentSmartClient,WebClient,NGClientsam
Sample
sIdentjavascriptlastDetailRowexistsname
exists()
dessIndent
Returns true if the file/directory exists on the filesystem - works on remote files too.
ret
Returns
sIndentclients
Supported Clients
sIndentSmartClient,WebClient,NGClientsam
Sample
sIdentjavascriptlastDetailRowgetAbsoluteFilename
getAbsoluteFile()
dessIndent
Returns a JSFile instance that corresponds to the absolute form of this pathname - works on remote files too.
ret
Returns
sIndentclients
Supported Clients
sIndentSmartClient,WebClient,NGClientsam
Sample
sIdentjavascriptlastDetailRowgetAbsolutePathname
getAbsolutePath()
dessIndent
Returns a String representation of the absolute form of this pathname - works on remote files too.
ret
Returns
sIndentclients
Supported Clients
sIndentSmartClient,WebClient,NGClientsam
Sample
sIdentjavascriptlastDetailRowgetBytesname
getBytes()
dessIndent
Gets the contents (bytes) for the file data.
ret
Returns
sIndentclients
Supported Clients
sIndentSmartClient,WebClient,NGClientsam
Sample
sIdentjavascriptlastDetailRowgetContentTypename
getContentType()
dessIndent
Returns the contenttype of this file, like for example 'application/pdf' - works on remote files too.
ret
Returns
sIndentclients
Supported Clients
sIndentSmartClient,WebClient,NGClientsam
Sample
sIdentjavascriptlastDetailRowgetNamename
getName()
dessIndent
Returns the name of the file. The name consists in the last part of the file path - works on remote files too.
ret
Returns
sIndentclients
Supported Clients
sIndentSmartClient,WebClient,NGClientsam
Sample
sIdentjavascriptlastDetailRowgetParentname
getParent()
dessIndent
Returns the String representation of the path of the parent of this file - works on remote files too.
ret
Returns
sIndentclients
Supported Clients
sIndentSmartClient,WebClient,NGClientsam
Sample
sIdentjavascriptlastDetailRowgetParentFilename
getParentFile()
dessIndent
Returns a JSFile instance that corresponds to the parent of this file - works on remote files too.
ret
Returns
sIndentclients
Supported Clients
sIndentSmartClient,WebClient,NGClientsam
Sample
sIdentjavascriptlastDetailRowgetPathname
getPath()
dessIndent
Returns a String holding the path to the file - works on remote files too.
ret
Returns
sIndentclients
Supported Clients
sIndentSmartClient,WebClient,NGClientsam
Sample
sIdentjavascriptlastDetailRowisAbsolutename
isAbsolute()
dessIndent
Returns true if the path is absolute. The path is absolute if it starts with '/' on Unix/Linux/MacOS or has a driver letter on Windows - works on remote files too.
ret
Returns
sIndentclients
Supported Clients
sIndentSmartClient,WebClient,NGClientsam
Sample
sIdentjavascriptlastDetailRowisDirectoryname
isDirectory()
dessIndent
Returns true if the file is a directory - works on remote files too.
ret
Returns
sIndentclients
Supported Clients
sIndentSmartClient,WebClient,NGClientsam
Sample
sIdentjavascriptlastDetailRowisFilename
isFile()
dessIndent
Returns true if the file is a file and not a regular file - works on remote files too.
ret
Returns
sIndentclients
Supported Clients
sIndentSmartClient,WebClient,NGClientsam
Sample
sIdentjavascriptlastDetailRowisHiddenname
isHidden()
dessIndent
Returns true if the file is hidden (a file system attribute) - works on remote files too.
ret
Returns
sIndentclients
Supported Clients
sIndentSmartClient,WebClient,NGClientsam
Sample
sIdentjavascriptlastDetailRowlastModifiedname
lastModified()
dessIndent
Returns the time/date of the last modification on the file - works on remote files too.
ret
Returns
sIndentclients
Supported Clients
sIndentSmartClient,WebClient,NGClientsam
Sample
sIdentjavascriptlastDetailRowlistname
list()
dessIndent
Returns an array of strings naming the files and directories located inside the file, if the file is a directory - works on remote files too.
ret
Returns
sIndentclients
Supported Clients
sIndentSmartClient,WebClient,NGClientsam
Sample
sIdentjavascriptlastDetailRowlistFilesname
listFiles()
dessIndent
Returns an array of JSFiles naming the files and directories located inside the file, if the file is a directory - works on remote files too.
ret
Returns
sIndentclients
Supported Clients
sIndentSmartClient,WebClient,NGClientsam
Sample
sIdentjavascriptlastDetailRowmkdirname
mkdir()
dessIndent
Creates a directory on disk if possible. Returns true if a new directory was created - for remote, use the streamFilesToServer to create the directory instead.
ret
Returns
sIndentclients
Supported Clients
sIndentSmartClient,WebClient,NGClientsam
Sample
sIdentjavascriptlastDetailRowmkdirsname
mkdirs()
dessIndent
Creates a directory on disk, together with all its parent directories, if possible. Returns true if the hierarchy of directories is created - for remote, use the streamFilesToServer to create the directories instead.
ret
Returns
sIndentclients
Supported Clients
sIndentSmartClient,WebClient,NGClientsam
Sample
sIdentjavascriptlastDetailRowrenameToname
renameTo(destination)
dessIndent
Renames the file to a different name. Returns true if the file could be renamed - works on remote files too.
prs
Parameters
sIndentdestination;ret
Returns
sIndentclients
Supported Clients
sIndentSmartClient,WebClient,NGClientsam
Sample
sIdentjavascriptlastDetailRowsetBytesname
setBytes(bytes)
dessIndent
Set the content of the file (local or remote) to the bytes provided<br/>
Will not create a new file if one doesn't exist
prs
Parameters
sIndentbytesthe dataret
Returns
sIndentclients
Supported Clients
sIndentSmartClient,WebClient,NGClientsam
Sample
sIdentjavascriptlastDetailRowsetBytesname
setBytes(bytes, createFile)
dessIndent
Set the content of the file (local or remote) to the bytes provided
prs
Parameters
sIndentbytesthe datacreateFiletrue to create a file if it doesn't existret
Returns
sIndentclients
Supported Clients
sIndentSmartClient,WebClient,NGClientsam
Sample
sIdentjavascriptlastDetailRowsetLastModifiedname
setLastModified(date)
dessIndent
Sets the date/time of the last modification on the file.
prs
Parameters
sIndentdate;ret
Returns
sIndentclients
Supported Clients
sIndentSmartClient,WebClient,NGClientsam
Sample
sIdentjavascriptlastDetailRowsetReadOnlyname
setReadOnly()
dessIndent
Sets the readonly attribute of the file/directory. Returns true on success.
ret
Returns
sIndentclients
Supported Clients
sIndentSmartClient,WebClient,NGClientsam
Sample
sIdentjavascriptlastDetailRowsizename
size()
dessIndent
Returns the size in bytes of the file. Returns 0 if the file does not exist on disk - works on remote files too.