{hidden}
DO NOT EDIT THE CONTENT OF THIS PAGE DIRECTLY, UNLESS YOU KNOW WHAT YOU'RE DOING.
		THE STRUCTURE OF THE CONTENT IS VITAL IN BEING ABLE TO EXTRACT CHANGES FROM THE PAGE AND MERGE THEM BACK INTO SERVOY SOURCE{hidden}
{sub-section:description|text=}{sub-section}\\{table:class=servoy sSummery}{colgroup}{column:width=80px}{column}{column}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=2}Method Summary{th}{tr}{tbody}{tr}{td}[Boolean]{td}{td}[#canRead]\()
Returns true if the file exists and is readable (has access to it).{td}{tr}{tbody}{tbody}{tr}{td}[Boolean]{td}{td}[#canWrite]\()
Returns true if the file exists and can be modified.{td}{tr}{tbody}{tbody}{tr}{td}[Boolean]{td}{td}[#createNewFile]\()
Creates the file on disk if needed.{td}{tr}{tbody}{tbody}{tr}{td}[Boolean]{td}{td}[#deleteFile]\()
Deletes the file from the disk if possible.{td}{tr}{tbody}{tbody}{tr}{td}[Boolean]{td}{td}[#exists]\()
Returns true if the file/directory exists on the filesystem.{td}{tr}{tbody}{tbody}{tr}{td}[JSFile]{td}{td}[#getAbsoluteFile]\()
Returns a JSFile instance that corresponds to the absolute form of this pathname.{td}{tr}{tbody}{tbody}{tr}{td}[String]{td}{td}[#getAbsolutePath]\()
Returns a String representation of the absolute form of this pathname.{td}{tr}{tbody}{tbody}{tr}{td}[String]{td}{td}[#getContentType]\()
Returns the contenttype of this file, like for example 'application/pdf'.{td}{tr}{tbody}{tbody}{tr}{td}[String]{td}{td}[#getName]\()
Returns the name of the file.{td}{tr}{tbody}{tbody}{tr}{td}[String]{td}{td}[#getParent]\()
Returns the String representation of the path of the parent of this file.{td}{tr}{tbody}{tbody}{tr}{td}[JSFile]{td}{td}[#getParentFile]\()
Returns a JSFile instance that corresponds to the parent of this file.{td}{tr}{tbody}{tbody}{tr}{td}[String]{td}{td}[#getPath]\()
Returns a String holding the path to the file.{td}{tr}{tbody}{tbody}{tr}{td}[Boolean]{td}{td}[#isAbsolute]\()
Returns true if the path is absolute.{td}{tr}{tbody}{tbody}{tr}{td}[Boolean]{td}{td}[#isDirectory]\()
Returns true if the file is a directory.{td}{tr}{tbody}{tbody}{tr}{td}[Boolean]{td}{td}[#isFile]\()
Returns true if the file is a file and not a regular file.{td}{tr}{tbody}{tbody}{tr}{td}[Boolean]{td}{td}[#isHidden]\()
Returns true if the file is hidden (a file system attribute).{td}{tr}{tbody}{tbody}{tr}{td}[Date]{td}{td}[#lastModified]\()
Returns the time/date of the last modification on the file.{td}{tr}{tbody}{tbody}{tr}{td}[String]\[]{td}{td}[#list]\()
Returns an array of strings naming the files and directories located inside the file, if the file is a directory.{td}{tr}{tbody}{tbody}{tr}{td}[JSFile]\[]{td}{td}[#listFiles]\()
Returns an array of JSFiles naming the files and directories located inside the file, if the file is a directory.{td}{tr}{tbody}{tbody}{tr}{td}[Boolean]{td}{td}[#mkdir]\()
Creates a directory on disk if possible.{td}{tr}{tbody}{tbody}{tr}{td}[Boolean]{td}{td}[#mkdirs]\()
Creates a directory on disk, together with all its parent directories, if possible.{td}{tr}{tbody}{tbody}{tr}{td}[Boolean]{td}{td}[#renameTo]\(destination)
Renames the file to a different name.{td}{tr}{tbody}{tbody}{tr}{td}[Boolean]{td}{td}[#setLastModified]\(date)
Sets the date/time of the last modification on the file.{td}{tr}{tbody}{tbody}{tr}{td}[Boolean]{td}{td}[#setReadOnly]\()
Sets the readonly attribute of the file/directory.{td}{tr}{tbody}{tbody}{tr}{td}[Number]{td}{td}[#size]\()
Returns the size in bytes of the file.{td}{tr}{tbody}{table}\\{table:class=servoy sDetail}{colgroup}{column:width=100%}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=1}Method Details{th}{tr}{tbody:id=6F7A24AD-9C9F-45B6-B496-6F7D7B84779E}{tr:id=name}{td}h6.canRead{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[Boolean]{span}{span:id=iets|style=float: left; font-weight: bold;}canRead{span}{span:id=iets|style=float: left;}\(){span}{td}{tr}{tr:id=des}{td}{sub-section:6F7A24AD-9C9F-45B6-B496-6F7D7B84779E_des|text=|trigger=button}{sub-section}{sub-section:6F7A24AD-9C9F-45B6-B496-6F7D7B84779E_des|trigger=none|class=sIndent}Returns true if the file exists and is readable (has access to it).{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:6F7A24AD-9C9F-45B6-B496-6F7D7B84779E_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:6F7A24AD-9C9F-45B6-B496-6F7D7B84779E_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:6F7A24AD-9C9F-45B6-B496-6F7D7B84779E_ret|text=|trigger=button}{sub-section}{sub-section:6F7A24AD-9C9F-45B6-B496-6F7D7B84779E_ret|trigger=none|class=sIndent}[Boolean]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:6F7A24AD-9C9F-45B6-B496-6F7D7B84779E_see|text=|trigger=button}{sub-section}{sub-section:6F7A24AD-9C9F-45B6-B496-6F7D7B84779E_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:6F7A24AD-9C9F-45B6-B496-6F7D7B84779E_see|text=|trigger=button}{sub-section}{sub-section:6F7A24AD-9C9F-45B6-B496-6F7D7B84779E_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:6F7A24AD-9C9F-45B6-B496-6F7D7B84779E_sam|text=|trigger=button}{sub-section}{sub-section:6F7A24AD-9C9F-45B6-B496-6F7D7B84779E_sam|class=sIndent|trigger=none}{code:language=javascript}
var f = plugins.file.convertToJSFile('./big.jpg');
if (f.exists()) {
	application.output('is absolute: ' + f.isAbsolute());
	application.output('is dir: ' + f.isDirectory());
	application.output('is file: ' + f.isFile());
	application.output('is hidden: ' + f.isHidden());
	application.output('can read: ' + f.canRead());
	application.output('can write: ' + f.canWrite());
	application.output('last modified: ' + f.lastModified());
	application.output('name: ' + f.getName());
	application.output('path: ' + f.getPath());
	application.output('absolute path: ' + f.getAbsolutePath());
	application.output('content type: ' + f.getContentType());
	application.output('size: ' + f.size());
}
else {
	application.output('File/folder not found.');
}
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=E705B7B7-E8D3-4ACE-A095-A99AAE4BC71F}{tr:id=name}{td}h6.canWrite{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[Boolean]{span}{span:id=iets|style=float: left; font-weight: bold;}canWrite{span}{span:id=iets|style=float: left;}\(){span}{td}{tr}{tr:id=des}{td}{sub-section:E705B7B7-E8D3-4ACE-A095-A99AAE4BC71F_des|text=|trigger=button}{sub-section}{sub-section:E705B7B7-E8D3-4ACE-A095-A99AAE4BC71F_des|trigger=none|class=sIndent}Returns true if the file exists and can be modified.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:E705B7B7-E8D3-4ACE-A095-A99AAE4BC71F_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:E705B7B7-E8D3-4ACE-A095-A99AAE4BC71F_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:E705B7B7-E8D3-4ACE-A095-A99AAE4BC71F_ret|text=|trigger=button}{sub-section}{sub-section:E705B7B7-E8D3-4ACE-A095-A99AAE4BC71F_ret|trigger=none|class=sIndent}[Boolean]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:E705B7B7-E8D3-4ACE-A095-A99AAE4BC71F_see|text=|trigger=button}{sub-section}{sub-section:E705B7B7-E8D3-4ACE-A095-A99AAE4BC71F_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:E705B7B7-E8D3-4ACE-A095-A99AAE4BC71F_see|text=|trigger=button}{sub-section}{sub-section:E705B7B7-E8D3-4ACE-A095-A99AAE4BC71F_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:E705B7B7-E8D3-4ACE-A095-A99AAE4BC71F_sam|text=|trigger=button}{sub-section}{sub-section:E705B7B7-E8D3-4ACE-A095-A99AAE4BC71F_sam|class=sIndent|trigger=none}{code:language=javascript}
var f = plugins.file.convertToJSFile('./big.jpg');
if (f.exists()) {
	application.output('is absolute: ' + f.isAbsolute());
	application.output('is dir: ' + f.isDirectory());
	application.output('is file: ' + f.isFile());
	application.output('is hidden: ' + f.isHidden());
	application.output('can read: ' + f.canRead());
	application.output('can write: ' + f.canWrite());
	application.output('last modified: ' + f.lastModified());
	application.output('name: ' + f.getName());
	application.output('path: ' + f.getPath());
	application.output('absolute path: ' + f.getAbsolutePath());
	application.output('content type: ' + f.getContentType());
	application.output('size: ' + f.size());
}
else {
	application.output('File/folder not found.');
}
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=E4A33047-CC9D-4F93-AA77-710168AA665F}{tr:id=name}{td}h6.createNewFile{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[Boolean]{span}{span:id=iets|style=float: left; font-weight: bold;}createNewFile{span}{span:id=iets|style=float: left;}\(){span}{td}{tr}{tr:id=des}{td}{sub-section:E4A33047-CC9D-4F93-AA77-710168AA665F_des|text=|trigger=button}{sub-section}{sub-section:E4A33047-CC9D-4F93-AA77-710168AA665F_des|trigger=none|class=sIndent}Creates the file on disk if needed. Returns true if the file (name) did not already exists and had to be created.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:E4A33047-CC9D-4F93-AA77-710168AA665F_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:E4A33047-CC9D-4F93-AA77-710168AA665F_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:E4A33047-CC9D-4F93-AA77-710168AA665F_ret|text=|trigger=button}{sub-section}{sub-section:E4A33047-CC9D-4F93-AA77-710168AA665F_ret|trigger=none|class=sIndent}[Boolean]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:E4A33047-CC9D-4F93-AA77-710168AA665F_see|text=|trigger=button}{sub-section}{sub-section:E4A33047-CC9D-4F93-AA77-710168AA665F_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:E4A33047-CC9D-4F93-AA77-710168AA665F_see|text=|trigger=button}{sub-section}{sub-section:E4A33047-CC9D-4F93-AA77-710168AA665F_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:E4A33047-CC9D-4F93-AA77-710168AA665F_sam|text=|trigger=button}{sub-section}{sub-section:E4A33047-CC9D-4F93-AA77-710168AA665F_sam|class=sIndent|trigger=none}{code:language=javascript}
var f = plugins.file.convertToJSFile('story.txt');
if (f.exists())
	f.deleteFile();
else
	f.createNewFile();
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=8AAA2449-246F-4FCD-898A-AC90588E4A4A}{tr:id=name}{td}h6.deleteFile{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[Boolean]{span}{span:id=iets|style=float: left; font-weight: bold;}deleteFile{span}{span:id=iets|style=float: left;}\(){span}{td}{tr}{tr:id=des}{td}{sub-section:8AAA2449-246F-4FCD-898A-AC90588E4A4A_des|text=|trigger=button}{sub-section}{sub-section:8AAA2449-246F-4FCD-898A-AC90588E4A4A_des|trigger=none|class=sIndent}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.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:8AAA2449-246F-4FCD-898A-AC90588E4A4A_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:8AAA2449-246F-4FCD-898A-AC90588E4A4A_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:8AAA2449-246F-4FCD-898A-AC90588E4A4A_ret|text=|trigger=button}{sub-section}{sub-section:8AAA2449-246F-4FCD-898A-AC90588E4A4A_ret|trigger=none|class=sIndent}[Boolean]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:8AAA2449-246F-4FCD-898A-AC90588E4A4A_see|text=|trigger=button}{sub-section}{sub-section:8AAA2449-246F-4FCD-898A-AC90588E4A4A_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:8AAA2449-246F-4FCD-898A-AC90588E4A4A_see|text=|trigger=button}{sub-section}{sub-section:8AAA2449-246F-4FCD-898A-AC90588E4A4A_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:8AAA2449-246F-4FCD-898A-AC90588E4A4A_sam|text=|trigger=button}{sub-section}{sub-section:8AAA2449-246F-4FCD-898A-AC90588E4A4A_sam|class=sIndent|trigger=none}{code:language=javascript}
var f = plugins.file.convertToJSFile('story.txt');
if (f.exists())
	f.deleteFile();
else
	f.createNewFile();
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=1BB9F3B7-30A7-46AD-8A47-4E0887FC6555}{tr:id=name}{td}h6.exists{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[Boolean]{span}{span:id=iets|style=float: left; font-weight: bold;}exists{span}{span:id=iets|style=float: left;}\(){span}{td}{tr}{tr:id=des}{td}{sub-section:1BB9F3B7-30A7-46AD-8A47-4E0887FC6555_des|text=|trigger=button}{sub-section}{sub-section:1BB9F3B7-30A7-46AD-8A47-4E0887FC6555_des|trigger=none|class=sIndent}Returns true if the file/directory exists on the filesystem.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:1BB9F3B7-30A7-46AD-8A47-4E0887FC6555_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:1BB9F3B7-30A7-46AD-8A47-4E0887FC6555_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:1BB9F3B7-30A7-46AD-8A47-4E0887FC6555_ret|text=|trigger=button}{sub-section}{sub-section:1BB9F3B7-30A7-46AD-8A47-4E0887FC6555_ret|trigger=none|class=sIndent}[Boolean]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:1BB9F3B7-30A7-46AD-8A47-4E0887FC6555_see|text=|trigger=button}{sub-section}{sub-section:1BB9F3B7-30A7-46AD-8A47-4E0887FC6555_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:1BB9F3B7-30A7-46AD-8A47-4E0887FC6555_see|text=|trigger=button}{sub-section}{sub-section:1BB9F3B7-30A7-46AD-8A47-4E0887FC6555_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:1BB9F3B7-30A7-46AD-8A47-4E0887FC6555_sam|text=|trigger=button}{sub-section}{sub-section:1BB9F3B7-30A7-46AD-8A47-4E0887FC6555_sam|class=sIndent|trigger=none}{code:language=javascript}
var f = plugins.file.convertToJSFile('./big.jpg');
if (f.exists()) {
	application.output('is absolute: ' + f.isAbsolute());
	application.output('is dir: ' + f.isDirectory());
	application.output('is file: ' + f.isFile());
	application.output('is hidden: ' + f.isHidden());
	application.output('can read: ' + f.canRead());
	application.output('can write: ' + f.canWrite());
	application.output('last modified: ' + f.lastModified());
	application.output('name: ' + f.getName());
	application.output('path: ' + f.getPath());
	application.output('absolute path: ' + f.getAbsolutePath());
	application.output('content type: ' + f.getContentType());
	application.output('size: ' + f.size());
}
else {
	application.output('File/folder not found.');
}
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=64767C4E-995C-4909-9FDF-E3894C7D7A11}{tr:id=name}{td}h6.getAbsoluteFile{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[JSFile]{span}{span:id=iets|style=float: left; font-weight: bold;}getAbsoluteFile{span}{span:id=iets|style=float: left;}\(){span}{td}{tr}{tr:id=des}{td}{sub-section:64767C4E-995C-4909-9FDF-E3894C7D7A11_des|text=|trigger=button}{sub-section}{sub-section:64767C4E-995C-4909-9FDF-E3894C7D7A11_des|trigger=none|class=sIndent}Returns a JSFile instance that corresponds to the absolute form of this pathname.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:64767C4E-995C-4909-9FDF-E3894C7D7A11_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:64767C4E-995C-4909-9FDF-E3894C7D7A11_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:64767C4E-995C-4909-9FDF-E3894C7D7A11_ret|text=|trigger=button}{sub-section}{sub-section:64767C4E-995C-4909-9FDF-E3894C7D7A11_ret|trigger=none|class=sIndent}[JSFile]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:64767C4E-995C-4909-9FDF-E3894C7D7A11_see|text=|trigger=button}{sub-section}{sub-section:64767C4E-995C-4909-9FDF-E3894C7D7A11_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:64767C4E-995C-4909-9FDF-E3894C7D7A11_see|text=|trigger=button}{sub-section}{sub-section:64767C4E-995C-4909-9FDF-E3894C7D7A11_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:64767C4E-995C-4909-9FDF-E3894C7D7A11_sam|text=|trigger=button}{sub-section}{sub-section:64767C4E-995C-4909-9FDF-E3894C7D7A11_sam|class=sIndent|trigger=none}{code:language=javascript}
var f = plugins.file.convertToJSFile('story.txt');
application.output('parent folder: ' + f.getAbsoluteFile().getParent());
application.output('parent folder has ' + f.getAbsoluteFile().getParentFile().listFiles().length + ' entries');
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=18B069E7-65AF-4E55-B441-4CE35A547176}{tr:id=name}{td}h6.getAbsolutePath{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[String]{span}{span:id=iets|style=float: left; font-weight: bold;}getAbsolutePath{span}{span:id=iets|style=float: left;}\(){span}{td}{tr}{tr:id=des}{td}{sub-section:18B069E7-65AF-4E55-B441-4CE35A547176_des|text=|trigger=button}{sub-section}{sub-section:18B069E7-65AF-4E55-B441-4CE35A547176_des|trigger=none|class=sIndent}Returns a String representation of the absolute form of this pathname.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:18B069E7-65AF-4E55-B441-4CE35A547176_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:18B069E7-65AF-4E55-B441-4CE35A547176_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:18B069E7-65AF-4E55-B441-4CE35A547176_ret|text=|trigger=button}{sub-section}{sub-section:18B069E7-65AF-4E55-B441-4CE35A547176_ret|trigger=none|class=sIndent}[String]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:18B069E7-65AF-4E55-B441-4CE35A547176_see|text=|trigger=button}{sub-section}{sub-section:18B069E7-65AF-4E55-B441-4CE35A547176_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:18B069E7-65AF-4E55-B441-4CE35A547176_see|text=|trigger=button}{sub-section}{sub-section:18B069E7-65AF-4E55-B441-4CE35A547176_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:18B069E7-65AF-4E55-B441-4CE35A547176_sam|text=|trigger=button}{sub-section}{sub-section:18B069E7-65AF-4E55-B441-4CE35A547176_sam|class=sIndent|trigger=none}{code:language=javascript}
var f = plugins.file.convertToJSFile('./big.jpg');
if (f.exists()) {
	application.output('is absolute: ' + f.isAbsolute());
	application.output('is dir: ' + f.isDirectory());
	application.output('is file: ' + f.isFile());
	application.output('is hidden: ' + f.isHidden());
	application.output('can read: ' + f.canRead());
	application.output('can write: ' + f.canWrite());
	application.output('last modified: ' + f.lastModified());
	application.output('name: ' + f.getName());
	application.output('path: ' + f.getPath());
	application.output('absolute path: ' + f.getAbsolutePath());
	application.output('content type: ' + f.getContentType());
	application.output('size: ' + f.size());
}
else {
	application.output('File/folder not found.');
}
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=86CE0D0A-37D2-47B3-AD1F-DCB4E133324A}{tr:id=name}{td}h6.getContentType{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[String]{span}{span:id=iets|style=float: left; font-weight: bold;}getContentType{span}{span:id=iets|style=float: left;}\(){span}{td}{tr}{tr:id=des}{td}{sub-section:86CE0D0A-37D2-47B3-AD1F-DCB4E133324A_des|text=|trigger=button}{sub-section}{sub-section:86CE0D0A-37D2-47B3-AD1F-DCB4E133324A_des|trigger=none|class=sIndent}Returns the contenttype of this file, like for example 'application/pdf'.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:86CE0D0A-37D2-47B3-AD1F-DCB4E133324A_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:86CE0D0A-37D2-47B3-AD1F-DCB4E133324A_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:86CE0D0A-37D2-47B3-AD1F-DCB4E133324A_ret|text=|trigger=button}{sub-section}{sub-section:86CE0D0A-37D2-47B3-AD1F-DCB4E133324A_ret|trigger=none|class=sIndent}[String]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:86CE0D0A-37D2-47B3-AD1F-DCB4E133324A_see|text=|trigger=button}{sub-section}{sub-section:86CE0D0A-37D2-47B3-AD1F-DCB4E133324A_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:86CE0D0A-37D2-47B3-AD1F-DCB4E133324A_see|text=|trigger=button}{sub-section}{sub-section:86CE0D0A-37D2-47B3-AD1F-DCB4E133324A_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:86CE0D0A-37D2-47B3-AD1F-DCB4E133324A_sam|text=|trigger=button}{sub-section}{sub-section:86CE0D0A-37D2-47B3-AD1F-DCB4E133324A_sam|class=sIndent|trigger=none}{code:language=javascript}
var f = plugins.file.convertToJSFile('./big.jpg');
if (f.exists()) {
	application.output('is absolute: ' + f.isAbsolute());
	application.output('is dir: ' + f.isDirectory());
	application.output('is file: ' + f.isFile());
	application.output('is hidden: ' + f.isHidden());
	application.output('can read: ' + f.canRead());
	application.output('can write: ' + f.canWrite());
	application.output('last modified: ' + f.lastModified());
	application.output('name: ' + f.getName());
	application.output('path: ' + f.getPath());
	application.output('absolute path: ' + f.getAbsolutePath());
	application.output('content type: ' + f.getContentType());
	application.output('size: ' + f.size());
}
else {
	application.output('File/folder not found.');
}
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=D55C1A7E-A418-402B-A989-BF3A138A2AF7}{tr:id=name}{td}h6.getName{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[String]{span}{span:id=iets|style=float: left; font-weight: bold;}getName{span}{span:id=iets|style=float: left;}\(){span}{td}{tr}{tr:id=des}{td}{sub-section:D55C1A7E-A418-402B-A989-BF3A138A2AF7_des|text=|trigger=button}{sub-section}{sub-section:D55C1A7E-A418-402B-A989-BF3A138A2AF7_des|trigger=none|class=sIndent}Returns the name of the file. The name consists in the last part of the file path.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:D55C1A7E-A418-402B-A989-BF3A138A2AF7_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:D55C1A7E-A418-402B-A989-BF3A138A2AF7_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:D55C1A7E-A418-402B-A989-BF3A138A2AF7_ret|text=|trigger=button}{sub-section}{sub-section:D55C1A7E-A418-402B-A989-BF3A138A2AF7_ret|trigger=none|class=sIndent}[String]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:D55C1A7E-A418-402B-A989-BF3A138A2AF7_see|text=|trigger=button}{sub-section}{sub-section:D55C1A7E-A418-402B-A989-BF3A138A2AF7_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:D55C1A7E-A418-402B-A989-BF3A138A2AF7_see|text=|trigger=button}{sub-section}{sub-section:D55C1A7E-A418-402B-A989-BF3A138A2AF7_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:D55C1A7E-A418-402B-A989-BF3A138A2AF7_sam|text=|trigger=button}{sub-section}{sub-section:D55C1A7E-A418-402B-A989-BF3A138A2AF7_sam|class=sIndent|trigger=none}{code:language=javascript}
var f = plugins.file.convertToJSFile('./big.jpg');
if (f.exists()) {
	application.output('is absolute: ' + f.isAbsolute());
	application.output('is dir: ' + f.isDirectory());
	application.output('is file: ' + f.isFile());
	application.output('is hidden: ' + f.isHidden());
	application.output('can read: ' + f.canRead());
	application.output('can write: ' + f.canWrite());
	application.output('last modified: ' + f.lastModified());
	application.output('name: ' + f.getName());
	application.output('path: ' + f.getPath());
	application.output('absolute path: ' + f.getAbsolutePath());
	application.output('content type: ' + f.getContentType());
	application.output('size: ' + f.size());
}
else {
	application.output('File/folder not found.');
}
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=32AA2F40-983D-469F-B180-470D77A0F204}{tr:id=name}{td}h6.getParent{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[String]{span}{span:id=iets|style=float: left; font-weight: bold;}getParent{span}{span:id=iets|style=float: left;}\(){span}{td}{tr}{tr:id=des}{td}{sub-section:32AA2F40-983D-469F-B180-470D77A0F204_des|text=|trigger=button}{sub-section}{sub-section:32AA2F40-983D-469F-B180-470D77A0F204_des|trigger=none|class=sIndent}Returns the String representation of the path of the parent of this file.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:32AA2F40-983D-469F-B180-470D77A0F204_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:32AA2F40-983D-469F-B180-470D77A0F204_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:32AA2F40-983D-469F-B180-470D77A0F204_ret|text=|trigger=button}{sub-section}{sub-section:32AA2F40-983D-469F-B180-470D77A0F204_ret|trigger=none|class=sIndent}[String]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:32AA2F40-983D-469F-B180-470D77A0F204_see|text=|trigger=button}{sub-section}{sub-section:32AA2F40-983D-469F-B180-470D77A0F204_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:32AA2F40-983D-469F-B180-470D77A0F204_see|text=|trigger=button}{sub-section}{sub-section:32AA2F40-983D-469F-B180-470D77A0F204_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:32AA2F40-983D-469F-B180-470D77A0F204_sam|text=|trigger=button}{sub-section}{sub-section:32AA2F40-983D-469F-B180-470D77A0F204_sam|class=sIndent|trigger=none}{code:language=javascript}
var f = plugins.file.convertToJSFile('story.txt');
application.output('parent folder: ' + f.getAbsoluteFile().getParent());
application.output('parent folder has ' + f.getAbsoluteFile().getParentFile().listFiles().length + ' entries');
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=1E9A0A77-D923-484C-B22D-84CD0CA7C4B4}{tr:id=name}{td}h6.getParentFile{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[JSFile]{span}{span:id=iets|style=float: left; font-weight: bold;}getParentFile{span}{span:id=iets|style=float: left;}\(){span}{td}{tr}{tr:id=des}{td}{sub-section:1E9A0A77-D923-484C-B22D-84CD0CA7C4B4_des|text=|trigger=button}{sub-section}{sub-section:1E9A0A77-D923-484C-B22D-84CD0CA7C4B4_des|trigger=none|class=sIndent}Returns a JSFile instance that corresponds to the parent of this file.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:1E9A0A77-D923-484C-B22D-84CD0CA7C4B4_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:1E9A0A77-D923-484C-B22D-84CD0CA7C4B4_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:1E9A0A77-D923-484C-B22D-84CD0CA7C4B4_ret|text=|trigger=button}{sub-section}{sub-section:1E9A0A77-D923-484C-B22D-84CD0CA7C4B4_ret|trigger=none|class=sIndent}[JSFile]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:1E9A0A77-D923-484C-B22D-84CD0CA7C4B4_see|text=|trigger=button}{sub-section}{sub-section:1E9A0A77-D923-484C-B22D-84CD0CA7C4B4_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:1E9A0A77-D923-484C-B22D-84CD0CA7C4B4_see|text=|trigger=button}{sub-section}{sub-section:1E9A0A77-D923-484C-B22D-84CD0CA7C4B4_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:1E9A0A77-D923-484C-B22D-84CD0CA7C4B4_sam|text=|trigger=button}{sub-section}{sub-section:1E9A0A77-D923-484C-B22D-84CD0CA7C4B4_sam|class=sIndent|trigger=none}{code:language=javascript}
var f = plugins.file.convertToJSFile('story.txt');
application.output('parent folder: ' + f.getAbsoluteFile().getParent());
application.output('parent folder has ' + f.getAbsoluteFile().getParentFile().listFiles().length + ' entries');
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=B5CDBEA3-39F4-4228-9F7B-C606A8C333C3}{tr:id=name}{td}h6.getPath{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[String]{span}{span:id=iets|style=float: left; font-weight: bold;}getPath{span}{span:id=iets|style=float: left;}\(){span}{td}{tr}{tr:id=des}{td}{sub-section:B5CDBEA3-39F4-4228-9F7B-C606A8C333C3_des|text=|trigger=button}{sub-section}{sub-section:B5CDBEA3-39F4-4228-9F7B-C606A8C333C3_des|trigger=none|class=sIndent}Returns a String holding the path to the file.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:B5CDBEA3-39F4-4228-9F7B-C606A8C333C3_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:B5CDBEA3-39F4-4228-9F7B-C606A8C333C3_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:B5CDBEA3-39F4-4228-9F7B-C606A8C333C3_ret|text=|trigger=button}{sub-section}{sub-section:B5CDBEA3-39F4-4228-9F7B-C606A8C333C3_ret|trigger=none|class=sIndent}[String]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:B5CDBEA3-39F4-4228-9F7B-C606A8C333C3_see|text=|trigger=button}{sub-section}{sub-section:B5CDBEA3-39F4-4228-9F7B-C606A8C333C3_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:B5CDBEA3-39F4-4228-9F7B-C606A8C333C3_see|text=|trigger=button}{sub-section}{sub-section:B5CDBEA3-39F4-4228-9F7B-C606A8C333C3_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:B5CDBEA3-39F4-4228-9F7B-C606A8C333C3_sam|text=|trigger=button}{sub-section}{sub-section:B5CDBEA3-39F4-4228-9F7B-C606A8C333C3_sam|class=sIndent|trigger=none}{code:language=javascript}
var f = plugins.file.convertToJSFile('./big.jpg');
if (f.exists()) {
	application.output('is absolute: ' + f.isAbsolute());
	application.output('is dir: ' + f.isDirectory());
	application.output('is file: ' + f.isFile());
	application.output('is hidden: ' + f.isHidden());
	application.output('can read: ' + f.canRead());
	application.output('can write: ' + f.canWrite());
	application.output('last modified: ' + f.lastModified());
	application.output('name: ' + f.getName());
	application.output('path: ' + f.getPath());
	application.output('absolute path: ' + f.getAbsolutePath());
	application.output('content type: ' + f.getContentType());
	application.output('size: ' + f.size());
}
else {
	application.output('File/folder not found.');
}
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=A1B8C9DD-DE28-49CC-8678-2F02A9E9BDF0}{tr:id=name}{td}h6.isAbsolute{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[Boolean]{span}{span:id=iets|style=float: left; font-weight: bold;}isAbsolute{span}{span:id=iets|style=float: left;}\(){span}{td}{tr}{tr:id=des}{td}{sub-section:A1B8C9DD-DE28-49CC-8678-2F02A9E9BDF0_des|text=|trigger=button}{sub-section}{sub-section:A1B8C9DD-DE28-49CC-8678-2F02A9E9BDF0_des|trigger=none|class=sIndent}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.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:A1B8C9DD-DE28-49CC-8678-2F02A9E9BDF0_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:A1B8C9DD-DE28-49CC-8678-2F02A9E9BDF0_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:A1B8C9DD-DE28-49CC-8678-2F02A9E9BDF0_ret|text=|trigger=button}{sub-section}{sub-section:A1B8C9DD-DE28-49CC-8678-2F02A9E9BDF0_ret|trigger=none|class=sIndent}[Boolean]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:A1B8C9DD-DE28-49CC-8678-2F02A9E9BDF0_see|text=|trigger=button}{sub-section}{sub-section:A1B8C9DD-DE28-49CC-8678-2F02A9E9BDF0_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:A1B8C9DD-DE28-49CC-8678-2F02A9E9BDF0_see|text=|trigger=button}{sub-section}{sub-section:A1B8C9DD-DE28-49CC-8678-2F02A9E9BDF0_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:A1B8C9DD-DE28-49CC-8678-2F02A9E9BDF0_sam|text=|trigger=button}{sub-section}{sub-section:A1B8C9DD-DE28-49CC-8678-2F02A9E9BDF0_sam|class=sIndent|trigger=none}{code:language=javascript}
var f = plugins.file.convertToJSFile('./big.jpg');
if (f.exists()) {
	application.output('is absolute: ' + f.isAbsolute());
	application.output('is dir: ' + f.isDirectory());
	application.output('is file: ' + f.isFile());
	application.output('is hidden: ' + f.isHidden());
	application.output('can read: ' + f.canRead());
	application.output('can write: ' + f.canWrite());
	application.output('last modified: ' + f.lastModified());
	application.output('name: ' + f.getName());
	application.output('path: ' + f.getPath());
	application.output('absolute path: ' + f.getAbsolutePath());
	application.output('content type: ' + f.getContentType());
	application.output('size: ' + f.size());
}
else {
	application.output('File/folder not found.');
}
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=6D44B729-400D-41C4-A9C1-EB1F5EB839BF}{tr:id=name}{td}h6.isDirectory{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[Boolean]{span}{span:id=iets|style=float: left; font-weight: bold;}isDirectory{span}{span:id=iets|style=float: left;}\(){span}{td}{tr}{tr:id=des}{td}{sub-section:6D44B729-400D-41C4-A9C1-EB1F5EB839BF_des|text=|trigger=button}{sub-section}{sub-section:6D44B729-400D-41C4-A9C1-EB1F5EB839BF_des|trigger=none|class=sIndent}Returns true if the file is a directory.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:6D44B729-400D-41C4-A9C1-EB1F5EB839BF_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:6D44B729-400D-41C4-A9C1-EB1F5EB839BF_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:6D44B729-400D-41C4-A9C1-EB1F5EB839BF_ret|text=|trigger=button}{sub-section}{sub-section:6D44B729-400D-41C4-A9C1-EB1F5EB839BF_ret|trigger=none|class=sIndent}[Boolean]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:6D44B729-400D-41C4-A9C1-EB1F5EB839BF_see|text=|trigger=button}{sub-section}{sub-section:6D44B729-400D-41C4-A9C1-EB1F5EB839BF_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:6D44B729-400D-41C4-A9C1-EB1F5EB839BF_see|text=|trigger=button}{sub-section}{sub-section:6D44B729-400D-41C4-A9C1-EB1F5EB839BF_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:6D44B729-400D-41C4-A9C1-EB1F5EB839BF_sam|text=|trigger=button}{sub-section}{sub-section:6D44B729-400D-41C4-A9C1-EB1F5EB839BF_sam|class=sIndent|trigger=none}{code:language=javascript}
var f = plugins.file.convertToJSFile('./big.jpg');
if (f.exists()) {
	application.output('is absolute: ' + f.isAbsolute());
	application.output('is dir: ' + f.isDirectory());
	application.output('is file: ' + f.isFile());
	application.output('is hidden: ' + f.isHidden());
	application.output('can read: ' + f.canRead());
	application.output('can write: ' + f.canWrite());
	application.output('last modified: ' + f.lastModified());
	application.output('name: ' + f.getName());
	application.output('path: ' + f.getPath());
	application.output('absolute path: ' + f.getAbsolutePath());
	application.output('content type: ' + f.getContentType());
	application.output('size: ' + f.size());
}
else {
	application.output('File/folder not found.');
}
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=049FEB78-5D4E-4846-A1E0-B5331049CB71}{tr:id=name}{td}h6.isFile{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[Boolean]{span}{span:id=iets|style=float: left; font-weight: bold;}isFile{span}{span:id=iets|style=float: left;}\(){span}{td}{tr}{tr:id=des}{td}{sub-section:049FEB78-5D4E-4846-A1E0-B5331049CB71_des|text=|trigger=button}{sub-section}{sub-section:049FEB78-5D4E-4846-A1E0-B5331049CB71_des|trigger=none|class=sIndent}Returns true if the file is a file and not a regular file.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:049FEB78-5D4E-4846-A1E0-B5331049CB71_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:049FEB78-5D4E-4846-A1E0-B5331049CB71_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:049FEB78-5D4E-4846-A1E0-B5331049CB71_ret|text=|trigger=button}{sub-section}{sub-section:049FEB78-5D4E-4846-A1E0-B5331049CB71_ret|trigger=none|class=sIndent}[Boolean]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:049FEB78-5D4E-4846-A1E0-B5331049CB71_see|text=|trigger=button}{sub-section}{sub-section:049FEB78-5D4E-4846-A1E0-B5331049CB71_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:049FEB78-5D4E-4846-A1E0-B5331049CB71_see|text=|trigger=button}{sub-section}{sub-section:049FEB78-5D4E-4846-A1E0-B5331049CB71_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:049FEB78-5D4E-4846-A1E0-B5331049CB71_sam|text=|trigger=button}{sub-section}{sub-section:049FEB78-5D4E-4846-A1E0-B5331049CB71_sam|class=sIndent|trigger=none}{code:language=javascript}
var f = plugins.file.convertToJSFile('./big.jpg');
if (f.exists()) {
	application.output('is absolute: ' + f.isAbsolute());
	application.output('is dir: ' + f.isDirectory());
	application.output('is file: ' + f.isFile());
	application.output('is hidden: ' + f.isHidden());
	application.output('can read: ' + f.canRead());
	application.output('can write: ' + f.canWrite());
	application.output('last modified: ' + f.lastModified());
	application.output('name: ' + f.getName());
	application.output('path: ' + f.getPath());
	application.output('absolute path: ' + f.getAbsolutePath());
	application.output('content type: ' + f.getContentType());
	application.output('size: ' + f.size());
}
else {
	application.output('File/folder not found.');
}
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=0F59B84E-D29B-42FF-A03E-F58735CC39DC}{tr:id=name}{td}h6.isHidden{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[Boolean]{span}{span:id=iets|style=float: left; font-weight: bold;}isHidden{span}{span:id=iets|style=float: left;}\(){span}{td}{tr}{tr:id=des}{td}{sub-section:0F59B84E-D29B-42FF-A03E-F58735CC39DC_des|text=|trigger=button}{sub-section}{sub-section:0F59B84E-D29B-42FF-A03E-F58735CC39DC_des|trigger=none|class=sIndent}Returns true if the file is hidden (a file system attribute).{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:0F59B84E-D29B-42FF-A03E-F58735CC39DC_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:0F59B84E-D29B-42FF-A03E-F58735CC39DC_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:0F59B84E-D29B-42FF-A03E-F58735CC39DC_ret|text=|trigger=button}{sub-section}{sub-section:0F59B84E-D29B-42FF-A03E-F58735CC39DC_ret|trigger=none|class=sIndent}[Boolean]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:0F59B84E-D29B-42FF-A03E-F58735CC39DC_see|text=|trigger=button}{sub-section}{sub-section:0F59B84E-D29B-42FF-A03E-F58735CC39DC_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:0F59B84E-D29B-42FF-A03E-F58735CC39DC_see|text=|trigger=button}{sub-section}{sub-section:0F59B84E-D29B-42FF-A03E-F58735CC39DC_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:0F59B84E-D29B-42FF-A03E-F58735CC39DC_sam|text=|trigger=button}{sub-section}{sub-section:0F59B84E-D29B-42FF-A03E-F58735CC39DC_sam|class=sIndent|trigger=none}{code:language=javascript}
var f = plugins.file.convertToJSFile('./big.jpg');
if (f.exists()) {
	application.output('is absolute: ' + f.isAbsolute());
	application.output('is dir: ' + f.isDirectory());
	application.output('is file: ' + f.isFile());
	application.output('is hidden: ' + f.isHidden());
	application.output('can read: ' + f.canRead());
	application.output('can write: ' + f.canWrite());
	application.output('last modified: ' + f.lastModified());
	application.output('name: ' + f.getName());
	application.output('path: ' + f.getPath());
	application.output('absolute path: ' + f.getAbsolutePath());
	application.output('content type: ' + f.getContentType());
	application.output('size: ' + f.size());
}
else {
	application.output('File/folder not found.');
}
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=04330969-0911-4AA0-8E5B-090819743F30}{tr:id=name}{td}h6.lastModified{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[Date]{span}{span:id=iets|style=float: left; font-weight: bold;}lastModified{span}{span:id=iets|style=float: left;}\(){span}{td}{tr}{tr:id=des}{td}{sub-section:04330969-0911-4AA0-8E5B-090819743F30_des|text=|trigger=button}{sub-section}{sub-section:04330969-0911-4AA0-8E5B-090819743F30_des|trigger=none|class=sIndent}Returns the time/date of the last modification on the file.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:04330969-0911-4AA0-8E5B-090819743F30_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:04330969-0911-4AA0-8E5B-090819743F30_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:04330969-0911-4AA0-8E5B-090819743F30_ret|text=|trigger=button}{sub-section}{sub-section:04330969-0911-4AA0-8E5B-090819743F30_ret|trigger=none|class=sIndent}[Date]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:04330969-0911-4AA0-8E5B-090819743F30_see|text=|trigger=button}{sub-section}{sub-section:04330969-0911-4AA0-8E5B-090819743F30_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:04330969-0911-4AA0-8E5B-090819743F30_see|text=|trigger=button}{sub-section}{sub-section:04330969-0911-4AA0-8E5B-090819743F30_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:04330969-0911-4AA0-8E5B-090819743F30_sam|text=|trigger=button}{sub-section}{sub-section:04330969-0911-4AA0-8E5B-090819743F30_sam|class=sIndent|trigger=none}{code:language=javascript}
var f = plugins.file.convertToJSFile('./big.jpg');
if (f.exists()) {
	application.output('is absolute: ' + f.isAbsolute());
	application.output('is dir: ' + f.isDirectory());
	application.output('is file: ' + f.isFile());
	application.output('is hidden: ' + f.isHidden());
	application.output('can read: ' + f.canRead());
	application.output('can write: ' + f.canWrite());
	application.output('last modified: ' + f.lastModified());
	application.output('name: ' + f.getName());
	application.output('path: ' + f.getPath());
	application.output('absolute path: ' + f.getAbsolutePath());
	application.output('content type: ' + f.getContentType());
	application.output('size: ' + f.size());
}
else {
	application.output('File/folder not found.');
}
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=7E86D687-6124-43F0-8675-6C1C1431864B}{tr:id=name}{td}h6.list{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[String]\[]{span}{span:id=iets|style=float: left; font-weight: bold;}list{span}{span:id=iets|style=float: left;}\(){span}{td}{tr}{tr:id=des}{td}{sub-section:7E86D687-6124-43F0-8675-6C1C1431864B_des|text=|trigger=button}{sub-section}{sub-section:7E86D687-6124-43F0-8675-6C1C1431864B_des|trigger=none|class=sIndent}Returns an array of strings naming the files and directories located inside the file, if the file is a directory.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:7E86D687-6124-43F0-8675-6C1C1431864B_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:7E86D687-6124-43F0-8675-6C1C1431864B_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:7E86D687-6124-43F0-8675-6C1C1431864B_ret|text=|trigger=button}{sub-section}{sub-section:7E86D687-6124-43F0-8675-6C1C1431864B_ret|trigger=none|class=sIndent}[String]\[]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:7E86D687-6124-43F0-8675-6C1C1431864B_see|text=|trigger=button}{sub-section}{sub-section:7E86D687-6124-43F0-8675-6C1C1431864B_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:7E86D687-6124-43F0-8675-6C1C1431864B_see|text=|trigger=button}{sub-section}{sub-section:7E86D687-6124-43F0-8675-6C1C1431864B_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:7E86D687-6124-43F0-8675-6C1C1431864B_sam|text=|trigger=button}{sub-section}{sub-section:7E86D687-6124-43F0-8675-6C1C1431864B_sam|class=sIndent|trigger=none}{code:language=javascript}
var d = plugins.file.convertToJSFile('plugins');
var names = d.list();
application.output('Names:');
for (var i=0; i<names.length; i++)
	application.output(names[i]);
var files = d.listFiles();
application.output('Absolute paths:');
for (var i=0; i<files.length; i++)
	application.output(files[i].getAbsolutePath());
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=7359462E-6C20-4B14-98F2-668E54AA080D}{tr:id=name}{td}h6.listFiles{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[JSFile]\[]{span}{span:id=iets|style=float: left; font-weight: bold;}listFiles{span}{span:id=iets|style=float: left;}\(){span}{td}{tr}{tr:id=des}{td}{sub-section:7359462E-6C20-4B14-98F2-668E54AA080D_des|text=|trigger=button}{sub-section}{sub-section:7359462E-6C20-4B14-98F2-668E54AA080D_des|trigger=none|class=sIndent}Returns an array of JSFiles naming the files and directories located inside the file, if the file is a directory.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:7359462E-6C20-4B14-98F2-668E54AA080D_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:7359462E-6C20-4B14-98F2-668E54AA080D_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:7359462E-6C20-4B14-98F2-668E54AA080D_ret|text=|trigger=button}{sub-section}{sub-section:7359462E-6C20-4B14-98F2-668E54AA080D_ret|trigger=none|class=sIndent}[JSFile]\[]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:7359462E-6C20-4B14-98F2-668E54AA080D_see|text=|trigger=button}{sub-section}{sub-section:7359462E-6C20-4B14-98F2-668E54AA080D_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:7359462E-6C20-4B14-98F2-668E54AA080D_see|text=|trigger=button}{sub-section}{sub-section:7359462E-6C20-4B14-98F2-668E54AA080D_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:7359462E-6C20-4B14-98F2-668E54AA080D_sam|text=|trigger=button}{sub-section}{sub-section:7359462E-6C20-4B14-98F2-668E54AA080D_sam|class=sIndent|trigger=none}{code:language=javascript}
var d = plugins.file.convertToJSFile('plugins');
var names = d.list();
application.output('Names:');
for (var i=0; i<names.length; i++)
	application.output(names[i]);
var files = d.listFiles();
application.output('Absolute paths:');
for (var i=0; i<files.length; i++)
	application.output(files[i].getAbsolutePath());
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=D59889D6-C90C-4293-A1CC-8F1B3D3AB4E1}{tr:id=name}{td}h6.mkdir{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[Boolean]{span}{span:id=iets|style=float: left; font-weight: bold;}mkdir{span}{span:id=iets|style=float: left;}\(){span}{td}{tr}{tr:id=des}{td}{sub-section:D59889D6-C90C-4293-A1CC-8F1B3D3AB4E1_des|text=|trigger=button}{sub-section}{sub-section:D59889D6-C90C-4293-A1CC-8F1B3D3AB4E1_des|trigger=none|class=sIndent}Creates a directory on disk if possible. Returns true if a new directory was created.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:D59889D6-C90C-4293-A1CC-8F1B3D3AB4E1_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:D59889D6-C90C-4293-A1CC-8F1B3D3AB4E1_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:D59889D6-C90C-4293-A1CC-8F1B3D3AB4E1_ret|text=|trigger=button}{sub-section}{sub-section:D59889D6-C90C-4293-A1CC-8F1B3D3AB4E1_ret|trigger=none|class=sIndent}[Boolean]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:D59889D6-C90C-4293-A1CC-8F1B3D3AB4E1_see|text=|trigger=button}{sub-section}{sub-section:D59889D6-C90C-4293-A1CC-8F1B3D3AB4E1_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:D59889D6-C90C-4293-A1CC-8F1B3D3AB4E1_see|text=|trigger=button}{sub-section}{sub-section:D59889D6-C90C-4293-A1CC-8F1B3D3AB4E1_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:D59889D6-C90C-4293-A1CC-8F1B3D3AB4E1_sam|text=|trigger=button}{sub-section}{sub-section:D59889D6-C90C-4293-A1CC-8F1B3D3AB4E1_sam|class=sIndent|trigger=none}{code:language=javascript}
var f = plugins.file.convertToJSFile('one/two/three/four');
f.mkdirs(); // Create all four levels of folders in one step.
var g = plugins.file.convertToJSFile('one/two/three/four/five');
g.mkdir(); // This will work because all parent folders are already created.
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=3AAA9FC1-6A17-4DE0-ABA8-2F7B59A1C504}{tr:id=name}{td}h6.mkdirs{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[Boolean]{span}{span:id=iets|style=float: left; font-weight: bold;}mkdirs{span}{span:id=iets|style=float: left;}\(){span}{td}{tr}{tr:id=des}{td}{sub-section:3AAA9FC1-6A17-4DE0-ABA8-2F7B59A1C504_des|text=|trigger=button}{sub-section}{sub-section:3AAA9FC1-6A17-4DE0-ABA8-2F7B59A1C504_des|trigger=none|class=sIndent}Creates a directory on disk, together with all its parent directories, if possible. Returns true if the hierarchy of directories is created.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:3AAA9FC1-6A17-4DE0-ABA8-2F7B59A1C504_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:3AAA9FC1-6A17-4DE0-ABA8-2F7B59A1C504_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:3AAA9FC1-6A17-4DE0-ABA8-2F7B59A1C504_ret|text=|trigger=button}{sub-section}{sub-section:3AAA9FC1-6A17-4DE0-ABA8-2F7B59A1C504_ret|trigger=none|class=sIndent}[Boolean]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:3AAA9FC1-6A17-4DE0-ABA8-2F7B59A1C504_see|text=|trigger=button}{sub-section}{sub-section:3AAA9FC1-6A17-4DE0-ABA8-2F7B59A1C504_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:3AAA9FC1-6A17-4DE0-ABA8-2F7B59A1C504_see|text=|trigger=button}{sub-section}{sub-section:3AAA9FC1-6A17-4DE0-ABA8-2F7B59A1C504_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:3AAA9FC1-6A17-4DE0-ABA8-2F7B59A1C504_sam|text=|trigger=button}{sub-section}{sub-section:3AAA9FC1-6A17-4DE0-ABA8-2F7B59A1C504_sam|class=sIndent|trigger=none}{code:language=javascript}
var f = plugins.file.convertToJSFile('one/two/three/four');
f.mkdirs(); // Create all four levels of folders in one step.
var g = plugins.file.convertToJSFile('one/two/three/four/five');
g.mkdir(); // This will work because all parent folders are already created.
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=5379AC9C-BB3C-4393-933B-095B888391B0}{tr:id=name}{td}h6.renameTo{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[Boolean]{span}{span:id=iets|style=float: left; font-weight: bold;}renameTo{span}{span:id=iets|style=float: left;}\(destination){span}{td}{tr}{tr:id=des}{td}{sub-section:5379AC9C-BB3C-4393-933B-095B888391B0_des|text=|trigger=button}{sub-section}{sub-section:5379AC9C-BB3C-4393-933B-095B888391B0_des|trigger=none|class=sIndent}Renames the file to a different name. Returns true if the file could be renamed.{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:5379AC9C-BB3C-4393-933B-095B888391B0_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:5379AC9C-BB3C-4393-933B-095B888391B0_prs|trigger=none}destination
{sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:5379AC9C-BB3C-4393-933B-095B888391B0_ret|text=|trigger=button}{sub-section}{sub-section:5379AC9C-BB3C-4393-933B-095B888391B0_ret|trigger=none|class=sIndent}[Boolean]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:5379AC9C-BB3C-4393-933B-095B888391B0_see|text=|trigger=button}{sub-section}{sub-section:5379AC9C-BB3C-4393-933B-095B888391B0_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:5379AC9C-BB3C-4393-933B-095B888391B0_see|text=|trigger=button}{sub-section}{sub-section:5379AC9C-BB3C-4393-933B-095B888391B0_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:5379AC9C-BB3C-4393-933B-095B888391B0_sam|text=|trigger=button}{sub-section}{sub-section:5379AC9C-BB3C-4393-933B-095B888391B0_sam|class=sIndent|trigger=none}{code:language=javascript}
var f = plugins.file.convertToJSFile('story.txt');
f.renameTo('otherstory.txt');
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=E821D552-4F5F-4DCB-8F06-474C2A647EFE}{tr:id=name}{td}h6.setLastModified{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[Boolean]{span}{span:id=iets|style=float: left; font-weight: bold;}setLastModified{span}{span:id=iets|style=float: left;}\(date){span}{td}{tr}{tr:id=des}{td}{sub-section:E821D552-4F5F-4DCB-8F06-474C2A647EFE_des|text=|trigger=button}{sub-section}{sub-section:E821D552-4F5F-4DCB-8F06-474C2A647EFE_des|trigger=none|class=sIndent}Sets the date/time of the last modification on the file.{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:E821D552-4F5F-4DCB-8F06-474C2A647EFE_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:E821D552-4F5F-4DCB-8F06-474C2A647EFE_prs|trigger=none}date
{sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:E821D552-4F5F-4DCB-8F06-474C2A647EFE_ret|text=|trigger=button}{sub-section}{sub-section:E821D552-4F5F-4DCB-8F06-474C2A647EFE_ret|trigger=none|class=sIndent}[Boolean]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:E821D552-4F5F-4DCB-8F06-474C2A647EFE_see|text=|trigger=button}{sub-section}{sub-section:E821D552-4F5F-4DCB-8F06-474C2A647EFE_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:E821D552-4F5F-4DCB-8F06-474C2A647EFE_see|text=|trigger=button}{sub-section}{sub-section:E821D552-4F5F-4DCB-8F06-474C2A647EFE_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:E821D552-4F5F-4DCB-8F06-474C2A647EFE_sam|text=|trigger=button}{sub-section}{sub-section:E821D552-4F5F-4DCB-8F06-474C2A647EFE_sam|class=sIndent|trigger=none}{code:language=javascript}
var f = plugins.file.convertToJSFile('story.txt');
f.createNewFile();
// Make the file look old.
f.setLastModified(new Date(1999, 5, 21));
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=C2DEF193-545C-4870-B4D8-DA937801F5FC}{tr:id=name}{td}h6.setReadOnly{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[Boolean]{span}{span:id=iets|style=float: left; font-weight: bold;}setReadOnly{span}{span:id=iets|style=float: left;}\(){span}{td}{tr}{tr:id=des}{td}{sub-section:C2DEF193-545C-4870-B4D8-DA937801F5FC_des|text=|trigger=button}{sub-section}{sub-section:C2DEF193-545C-4870-B4D8-DA937801F5FC_des|trigger=none|class=sIndent}Sets the readonly attribute of the file/directory. Returns true on success.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:C2DEF193-545C-4870-B4D8-DA937801F5FC_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:C2DEF193-545C-4870-B4D8-DA937801F5FC_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:C2DEF193-545C-4870-B4D8-DA937801F5FC_ret|text=|trigger=button}{sub-section}{sub-section:C2DEF193-545C-4870-B4D8-DA937801F5FC_ret|trigger=none|class=sIndent}[Boolean]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:C2DEF193-545C-4870-B4D8-DA937801F5FC_see|text=|trigger=button}{sub-section}{sub-section:C2DEF193-545C-4870-B4D8-DA937801F5FC_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:C2DEF193-545C-4870-B4D8-DA937801F5FC_see|text=|trigger=button}{sub-section}{sub-section:C2DEF193-545C-4870-B4D8-DA937801F5FC_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:C2DEF193-545C-4870-B4D8-DA937801F5FC_sam|text=|trigger=button}{sub-section}{sub-section:C2DEF193-545C-4870-B4D8-DA937801F5FC_sam|class=sIndent|trigger=none}{code:language=javascript}
var f = plugins.file.convertToJSFile('invoice.txt');
plugins.file.writeTXTFile(f, 'important data that should not be changed');
f.setReadOnly();
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=D8B088A3-827D-4919-A756-FE35C61DE2CC}{tr:id=name}{td}h6.size{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[Number]{span}{span:id=iets|style=float: left; font-weight: bold;}size{span}{span:id=iets|style=float: left;}\(){span}{td}{tr}{tr:id=des}{td}{sub-section:D8B088A3-827D-4919-A756-FE35C61DE2CC_des|text=|trigger=button}{sub-section}{sub-section:D8B088A3-827D-4919-A756-FE35C61DE2CC_des|trigger=none|class=sIndent}Returns the size in bytes of the file. Returns 0 if the file does not exist on disk.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:D8B088A3-827D-4919-A756-FE35C61DE2CC_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:D8B088A3-827D-4919-A756-FE35C61DE2CC_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:D8B088A3-827D-4919-A756-FE35C61DE2CC_ret|text=|trigger=button}{sub-section}{sub-section:D8B088A3-827D-4919-A756-FE35C61DE2CC_ret|trigger=none|class=sIndent}[Number]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:D8B088A3-827D-4919-A756-FE35C61DE2CC_see|text=|trigger=button}{sub-section}{sub-section:D8B088A3-827D-4919-A756-FE35C61DE2CC_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:D8B088A3-827D-4919-A756-FE35C61DE2CC_see|text=|trigger=button}{sub-section}{sub-section:D8B088A3-827D-4919-A756-FE35C61DE2CC_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:D8B088A3-827D-4919-A756-FE35C61DE2CC_sam|text=|trigger=button}{sub-section}{sub-section:D8B088A3-827D-4919-A756-FE35C61DE2CC_sam|class=sIndent|trigger=none}{code:language=javascript}
var f = plugins.file.convertToJSFile('./big.jpg');
if (f.exists()) {
	application.output('is absolute: ' + f.isAbsolute());
	application.output('is dir: ' + f.isDirectory());
	application.output('is file: ' + f.isFile());
	application.output('is hidden: ' + f.isHidden());
	application.output('can read: ' + f.canRead());
	application.output('can write: ' + f.canWrite());
	application.output('last modified: ' + f.lastModified());
	application.output('name: ' + f.getName());
	application.output('path: ' + f.getPath());
	application.output('absolute path: ' + f.getAbsolutePath());
	application.output('content type: ' + f.getContentType());
	application.output('size: ' + f.size());
}
else {
	application.output('File/folder not found.');
}
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{table}