Skip to main content

File

O objeto File é utilizado para interagir com ficheiros e pastas.


available


available() : int

Description

Returns the number of estimated bytes left to read a file

Return

( int )


baseName


baseName() : string

Return

( string )


bufferedReader


bufferedReader() : java.io.BufferedReader

Return

( java.io.BufferedReader )


bufferedReader(bufferSize: int) : java.io.BufferedReader

Attributes
NAMETYPEDESCRIPTION
bufferSizeint
Return

( java.io.BufferedReader )


bufferedReader(bufferSize: int, charset: string) : java.io.BufferedReader

Attributes
NAMETYPEDESCRIPTION
bufferSizeint
charsetstring
Return

( java.io.BufferedReader )


bufferedReader(bufferSize: int, charset: java.nio.charset.Charset) : java.io.BufferedReader

Attributes
NAMETYPEDESCRIPTION
bufferSizeint
charsetjava.nio.charset.Charset
Return

( java.io.BufferedReader )


bufferedReader(charset: string) : java.io.BufferedReader

Attributes
NAMETYPEDESCRIPTION
charsetstring
Return

( java.io.BufferedReader )


bufferedReader(charset: java.nio.charset.Charset) : java.io.BufferedReader

Attributes
NAMETYPEDESCRIPTION
charsetjava.nio.charset.Charset
Return

( java.io.BufferedReader )


bytes


bytes() : byte[]

Description

Returns the number of estimated bytes left to read a file

Return

( byte[] )


contentType


contentType() : string

Return

( string )


contentType(contentType: string) : File

Attributes
NAMETYPEDESCRIPTION
contentTypestring
Return

( File )


copy


copy(destPath: string) : boolean

Description

Copies the file to the inserted path

Attributes
NAMETYPEDESCRIPTION
destPathstringPath where to copy the file/directory.
Return

( boolean )


copy(destPath: string, override: boolean) : boolean

Description

Copies the file of the inserted path with override option if exists a file

Attributes
NAMETYPEDESCRIPTION
destPathstringPath where to copy the file/directory.
overridebooleanOverride if exists a file already.
Return

( boolean )


copyFiles


copyFiles(destPath: string, extension: string) : boolean

Description

Copies the files by the inserted extension to the inserted path.

Attributes
NAMETYPEDESCRIPTION
destPathstringPath where to copy the file/directory.
extensionstringFile extension.
Return

( boolean )


delete


delete() : boolean

Description

Deletes the file of the inserted file

Return

( boolean )


deleteAll


deleteAll() : boolean

Description

Deletes a file/directory and recursive all the subs

Return

( boolean )


deleteAll(extension: string) : boolean

Description

Deletes a file/directory by the file extension

Attributes
NAMETYPEDESCRIPTION
extensionstring
Return

( boolean )


deleteFiles


deleteFiles() : boolean

Description

Deletes a file/directory and recursive all the subs

Return

( boolean )


deleteFiles(stringExtension: string) : boolean

Description

Deletes a file of a inserted extension and recursive all the subs

Attributes
NAMETYPEDESCRIPTION
stringExtensionstringString extension of the file.
Return

( boolean )


ensureJail


ensureJail(jailPath: string) : File

Attributes
NAMETYPEDESCRIPTION
jailPathstring
Return

( File )


exists


exists() : boolean

Description

Returns a boolean result that verify if the inserted path exists

Return

( boolean )


extension


extension() : string

Return

( string )


fullPath


fullPath() : string

Description

Allows to get the complete path of the file.

Return

( string )


getBaseName


getBaseName() : string

Description

Returns the base name of the present file

Return

( string )


getBytes


getBytes() : byte[]

Description

Returns the number of estimated bytes left to read a file

Return

( byte[] )


getContentType


getContentType() : string

Return

( string )


getExtension


getExtension() : string

Return

( string )


getFullPath


getFullPath() : string

Description

Returns the full path until the present file

Return

( string )


getInput


getInput() : InputStream

Return

( InputStream )


getInputStream


getInputStream() : InputStream

Description

Returns the number of estimated bytes

Return

( InputStream )


getName


getName() : string

Description

Returns the name of a file

Return

( string )


getName(path: string) : string

Description

Returns the name of a file in the inserted path

Attributes
NAMETYPEDESCRIPTION
pathstringPath to the file/directory.
Return

( string )


getOutput


getOutput() : OutputStream

Return

( OutputStream )


getOutputStream


getOutputStream() : OutputStream

Return

( OutputStream )


getPath


getPath() : string

Description

Returns the path

Return

( string )


getPhysicalPath


getPhysicalPath() : string

Return

( string )


getSequenceName


getSequenceName(targetPath: java.io.File, fileName: string) : string

Description

Returns the name of the inserted file with a sequence number if the file already exists with the original name

Attributes
NAMETYPEDESCRIPTION
targetPathjava.io.FilePath to the file/directory.
fileNamestringName of the file.
Return

( string )


getSequenceName(targetPath: string, fileName: string) : string

Description

Returns the name of the inserted file with a sequence number if the file already exists with the original name

Attributes
NAMETYPEDESCRIPTION
targetPathstringPath to the file/directory.
fileNamestringName of the file.
Return

( string )


input


input() : InputStream

Return

( InputStream )


inputStream


inputStream() : InputStream

Return

( InputStream )


isBaseName


isBaseName(baseName: string) : boolean

Attributes
NAMETYPEDESCRIPTION
baseNamestring
Return

( boolean )


isDirectory


isDirectory() : boolean

Description

Returns a boolean result that verify if the inserted path is a directory

Return

( boolean )


isExtension


isExtension(extension: string) : boolean

Attributes
NAMETYPEDESCRIPTION
extensionstring
Return

( boolean )


isFile


isFile() : boolean

Description

Returns a boolean result that verify if the inserted path is a file

Return

( boolean )


isJail


isJail() : boolean

Description

Does a authentication if the file has his location limited to another folder

Return

( boolean )


lastModified


lastModified() : long

Description

Returns the hour that the file of the inserted path was last modified

Return

( long )


list


list() : java.util.List

Description

Returns a list of all the files and directories on the inserted path

Return

( java.util.List )


mkdir


mkdir() : boolean

Description

Creates a directory in the present path.

Return

( boolean )


mkdirs


mkdirs() : boolean

Return

( boolean )


name


name() : string

Description

Returns the name of a file

Return

( string )


output


output() : OutputStream

Return

( OutputStream )


outputStream


outputStream() : OutputStream

Return

( OutputStream )


path


path() : string

Description

Returns the path of the file/directory

Return

( string )

Returns a boolean verification of the existence of the file and tracks it folder location.


physicalPath


physicalPath() : string

Description

Allows to get the path of the file.

Return

( string )


reader


reader() : java.io.Reader

Return

( java.io.Reader )


readerBOM


readerBOM() : java.io.Reader

Return

( java.io.Reader )


readerBOM(charsetName: string) : java.io.Reader

Attributes
NAMETYPEDESCRIPTION
charsetNamestring
Return

( java.io.Reader )


rename


rename(newName: string) : boolean

Description

Renames a file with the new name inserted

Attributes
NAMETYPEDESCRIPTION
newNamestringNew name to rename the file.
Return

( boolean )


renameTo


renameTo(destPath: string) : boolean

Description

Renames the file of the inserted file

Attributes
NAMETYPEDESCRIPTION
destPathstringPath to the file/directory.
Return

( boolean )


save


save(path: java.lang.Object) : void

Description

Saves the file in the inserted path

Attributes
NAMETYPEDESCRIPTION
pathjava.lang.ObjectPath of the file.
Return

( void )


save(path: string) : void

Description

Saves the file in the inserted path

Attributes
NAMETYPEDESCRIPTION
pathstringPath where to save the file.
Return

( void )


sequenceName


sequenceName(targetPath: java.io.File, fileName: string) : string

Attributes
NAMETYPEDESCRIPTION
targetPathjava.io.File
fileNamestring
Return

( string )


sequenceName(targetPath: string, fileName: string) : string

Attributes
NAMETYPEDESCRIPTION
targetPathstring
fileNamestring
Return

( string )


setContentType


setContentType(contentType: string) : File

Attributes
NAMETYPEDESCRIPTION
contentTypestring
Return

( File )


writer


writer() : java.io.Writer

Return

( java.io.Writer )