Перейти к основному содержимому

File

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


available​


available() : long​

Description​

Returns the number of bytes required to read the file.

Return​

( long )


baseName​


baseName() : string​

Description​

Returns the base name of the present file

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​

Delete the file or folder if it is empty.

Return​

( boolean )


deleteAll​


deleteAll() : boolean​

Description​

Delete everything inside the folder, including all subfolders and files.

Return​

( boolean )


deleteAllFiles​


deleteAllFiles() : boolean​

Description​

Deletes all files within the folder structure including subfolders.

Return​

( boolean )


deleteAllFiles(extension: string) : boolean​

Description​

Delete all files by extension, within the folder structure including subfolders.

Attributes​
NAMETYPEDESCRIPTION
extensionstring
Return​

( boolean )


deleteFiles​


deleteFiles() : boolean​

Description​

It only deletes files within the folder; it does not delete files in subfolders.

Return​

( boolean )


deleteFiles(stringExtension: string) : boolean​

Description​

It only deletes files with the extension within the folder, and does not delete any files in subfolders.

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 )


fullURI​


fullURI() : string​

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​

Description​

Allows to get the path of the file.

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 )


inMemoryFile​


inMemoryFile() : boolean​

Return​

( boolean )


input​


input() : InputStream​

Return​

( InputStream )


inputStream​


inputStream() : InputStream​

Description​

Returns the number of estimated bytes

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 )


isInMemoryFile​


isInMemoryFile() : boolean​

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<File>​

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​

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 )


sequenceName(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 )


setContentType​


setContentType(contentType: string) : File​

Attributes​
NAMETYPEDESCRIPTION
contentTypestring
Return​

( File )


size​


size() : long​

Return​

( long )


sizeGB​


sizeGB() : double​

Return​

( double )


sizeKB​


sizeKB() : double​

Return​

( double )


sizeMB​


sizeMB() : double​

Return​

( double )


uri​


uri() : string​

Return​

( string )


writer​


writer() : java.io.Writer​

Return​

( java.io.Writer )