Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Cache
indextrue
refresh100d
showRefreshtrue
iddoc
titleRefresh page
showDatetrue
retryEnable

servoy sReturnTypes2100%height: 30px;2Supported ClientssWordListSmartClientsWordListWebClientsWordListNGClient

servoy 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

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRowcanWritename

canWrite()

dessIndent
Returns true if the file exists and can be modified - works on remote files too.
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
createNewFilename

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

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
deleteFilename

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

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
existsname

exists()

dessIndent
Returns true if the file/directory exists on the filesystem - works on remote files too.
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
getAbsoluteFilename

getAbsoluteFile()

dessIndent
Returns a JSFile instance that corresponds to the absolute form of this pathname - works on remote files too.
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
getAbsolutePathname

getAbsolutePath()

dessIndent
Returns a String representation of the absolute form of this pathname - works on remote files too.
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
getBytesname

getBytes()

dessIndent
Gets the contents (bytes) for the file data.
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
getContentTypename

getContentType()

dessIndent
Returns the contenttype of this file, like for example 'application/pdf' - works on remote files too.
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
getNamename

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

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
getParentname

getParent()

dessIndent
Returns the String representation of the path of the parent of this file - works on remote files too.
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
getParentFilename

getParentFile()

dessIndent
Returns a JSFile instance that corresponds to the parent of this file - works on remote files too.
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
getPathname

getPath()

dessIndent
Returns a String holding the path to the file - works on remote files too.
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
isAbsolutename

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

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
isDirectoryname

isDirectory()

dessIndent
Returns true if the file is a directory - works on remote files too.
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
isFilename

isFile()

dessIndent
Returns true if the file is a file and not a regular file - works on remote files too.
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
isHiddenname

isHidden()

dessIndent
Returns true if the file is hidden (a file system attribute) - works on remote files too.
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
lastModifiedname

lastModified()

dessIndent
Returns the time/date of the last modification on the file - works on remote files too.
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
listname

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

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
listFilesname

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

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
mkdirname

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

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
mkdirsname

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

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
renameToname

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

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
setBytesname

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 data
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
setBytesname

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 exist
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
setLastModifiedname

setLastModified(date)

dessIndent
Sets the date/time of the last modification on the file.
prs

Parameters

sIndentdate ;
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
setReadOnlyname

setReadOnly()

dessIndent
Sets the readonly attribute of the file/directory. Returns true on success.
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
sizename

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.
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow