FileIOandStreams_I

FileIOandStreams_I - CIS3023: Programming Fundamentals for...

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon
CIS3023: Programming Fundamentals for CIS Majors II Summer 2010 Ganesh Viswanathan File I/O and Streams (Part I) Course Lecture Slides 12 th July 2010
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
The File Class java.io package Provides for system input and output through data streams , serialization and the file system . 2 http://download.oracle.com/docs/cd/E17476_01/javase/1.5.0/docs/api/java/io/package- summary.html
Background image of page 2
The File Class 3 java.io.File +File(pathname: String) +File(parent: String, child: String) +File(parent: File, child: String) +exists(): boolean +canRead(): boolean +canWrite(): boolean +isDirectory(): boolean +isFile(): boolean +isAbsolute(): boolean +isHidden(): boolean +getAbsolutePath(): String +getCanonicalPath(): String +getName(): String +getPath(): String +getParent(): String +lastModified(): long +delete(): boolean +renameTo(dest: File): boolean Creates a File object for the specified pathname. The pathname may be a directory or a file. Creates a File object for the child under the directory parent. child may be a filename or a subdirectory. Creates a File object for the child under the directory parent. parent is a File object. In the preceding constructor, the parent is a string. Returns true if the file or the directory represented by the File object exists. Returns true if the file represented by the File object exists and can be read. Returns true if the file represented by the File object exists and can be written. Returns true if the File object represents a directory. Returns true if the File object represents a file. Returns true if the File object is created using an absolute path name. Returns true if the file represented in the File object is hidden. The exact definition of hidden is system-dependent. On Windows, you can mark a file hidden in the File Properties dialog box. On Unix systems, a file is hidden if
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 14

FileIOandStreams_I - CIS3023: Programming Fundamentals for...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online