File.File

File.File

Class Overview | Class Members | This Package | All Packages

Syntax 1
public File( String path )
Parameters
path
the file pathname.
Description
Creates a File instance that represents the file whose pathname is the given path argument.

Exceptions
NullPointerException if the file path is equal to null.
See Also
getPath



Syntax 2
public File( String path, String name )
Parameters
path
the directory pathname.
name
the file pathname.
Description
Creates a File instance whose pathname is the pathname of the specified directory, followed by the separator character, followed by the name argument.

See Also
getPath, separator



Syntax 3
public File( File dir, String name )
Parameters
dir
the directory.
name
the file pathname.
Description
Creates a File instance that represents the file with the specified name in the specified directory.

If the directory argument is null, the resulting File instance represents a file in the (system-dependent) current directory whose pathname is the name argument. Otherwise, the File instance represents a file whose pathname is the pathname of the directory, followed by the separator character, followed by the name argument.

See Also
getPath, separator