Home
Explore
Exams
Search for anything
Login
Get started
Home
File, input and output
File, input and output
0.0
(0)
Rate it
Studied by 0 people
Learn
Practice Test
Spaced Repetition
Match
Flashcards
Card Sorting
1/91
There's no tags or description
Looks like no tags are added yet.
Study Analytics
All
Learn
Practice Test
Matching
Spaced Repetition
Name
Mastery
Learn
Test
Matching
Spaced
No study sessions yet.
92 Terms
View all (92)
Star these 92
1
New cards
Computer File
Collection of data stored on nonvolatile devices.
2
New cards
Text File
Contains readable data encoded in ASCII or Unicode.
3
New cards
Binary File
Contains data in binary format, not human-readable.
4
New cards
Root Directory
Main directory of a storage device.
5
New cards
Path
Complete list of directories leading to a file.
6
New cards
Path Identifier
Character separating path components in Windows.
7
New cards
Delimiter
Character separating path components in UNIX.
8
New cards
File Operations
Tasks like opening, reading, and deleting files.
9
New cards
Path Class
Creates objects with file and directory information.
10
New cards
Files Class
Performs operations on files and directories.
11
New cards
java.nio.file
Java package for file and path handling.
12
New cards
FileSystem Class
Instantiates objects representing the file system.
13
New cards
FileSystems Class
Contains factory methods for creating FileSystem objects.
14
New cards
getDefault() Method
Returns the default file system instance.
15
New cards
getPath() Method
Defines a path using the file system.
16
New cards
Escape Sequence
Backslash used to denote special characters in strings.
17
New cards
Hierarchy
Organizational structure of folders within directories.
18
New cards
Folder
Container for organizing files on a storage device.
19
New cards
Creation Date
Timestamp indicating when a file was created.
20
New cards
File Size
Amount of disk space occupied by a file.
21
New cards
File Attributes
Metadata describing properties of a file.
22
New cards
Input Stream
Flow of data read from a file.
23
New cards
Output Stream
Flow of data written to a file.
24
New cards
Path Delimiter
Use double backslashes for a single backslash.
25
New cards
Paths Class
Helper class to create Path objects easily.
26
New cards
get() Method
Calls getPath() without needing FileSystem object.
27
New cards
Path Object
Represents a file path in the application.
28
New cards
Absolute Path
Complete path to locate a file directly.
29
New cards
Relative Path
Path dependent on current directory context.
30
New cards
toAbsolutePath() Method
Converts relative path to absolute path.
31
New cards
PathDemo2 Program
Converts user input filename to absolute path.
32
New cards
toString() Method
Returns String representation of the Path.
33
New cards
getFileName() Method
Returns last element in the Path sequence.
34
New cards
getNameCount() Method
Counts name elements in the Path.
35
New cards
getName(int) Method
Retrieves name at specified index in Path.
36
New cards
Path Indexing
Top-level element is at index 0.
37
New cards
File System
Organizes files and directories on a computer.
38
New cards
Current Directory
Folder where the program is executed.
39
New cards
SampleFile.txt
Example file referenced in path operations.
40
New cards
Path Syntax
C:\Java\Chapter.11\SampleFile.txt is a valid path.
41
New cards
Path Operations
Use Path object to perform file operations.
42
New cards
Java Scanner
Used to read user input in programs.
43
New cards
Path Representation
Path is known as filePath in the application.
44
New cards
Subfolder
Folder contained within another folder.
45
New cards
Path Methods Summary
Useful methods for manipulating Path objects.
46
New cards
Path
Represents a file or directory location.
47
New cards
Paths.get()
Creates a Path object from a string.
48
New cards
getNameCount()
Returns number of elements in the path.
49
New cards
getFileName()
Retrieves the file name from the path.
50
New cards
checkAccess()
Verifies file accessibility permissions.
51
New cards
AccessMode
Constants for file access permissions.
52
New cards
READ
Permission to read the file.
53
New cards
WRITE
Permission to write to the file.
54
New cards
EXECUTE
Permission to execute the file.
55
New cards
Files.exists()
Checks if a file exists at the path.
56
New cards
IOException
Exception thrown for file access issues.
57
New cards
readAttributes()
Retrieves file attributes using a Path.
58
New cards
BasicFileAttributes
Class containing basic file attribute methods.
59
New cards
size()
Returns file size in bytes.
60
New cards
creationTime()
Returns file creation timestamp.
61
New cards
lastModifiedTime()
Returns last modified timestamp of the file.
62
New cards
PathDemo
Example program demonstrating file path operations.
63
New cards
PathDemo3
Checks if a file can be read and executed.
64
New cards
PathDemo4
Demonstrates retrieving file attributes.
65
New cards
getFileSystem()
Retrieves the file system associated with the path.
66
New cards
provider()
Gets the file system provider.
67
New cards
try-catch
Handles exceptions during file access.
68
New cards
System.out.println()
Prints output to the console.
69
New cards
for loop
Iterates over elements in the file path.
70
New cards
Path
Represents file and directory pathnames.
71
New cards
Paths
Utility class for creating Path instances.
72
New cards
BasicFileAttributes
Stores file attributes like creation time.
73
New cards
FileTime
Represents time in yyyy-mm-ddThh:mm:ss format.
74
New cards
InputStream
Abstract class for input operations.
75
New cards
OutputStream
Abstract class for output operations.
76
New cards
FileInputStream
Reads data from disk files.
77
New cards
FileOutputStream
Writes data to disk files.
78
New cards
BufferedInputStream
Buffers input for efficient reading.
79
New cards
BufferedOutputStream
Buffers output for efficient writing.
80
New cards
PrintStream
Handles output to standard output device.
81
New cards
Reader
Abstract class for reading character streams.
82
New cards
BufferedReader
Buffers characters for efficient reading.
83
New cards
BufferedWriter
Buffers characters for efficient writing.
84
New cards
getBytes()
Converts String to byte array.
85
New cards
flush()
Flushes buffered output stream.
86
New cards
close()
Closes the output stream.
87
New cards
write(byte[] b)
Writes byte array to output stream.
88
New cards
write(byte[] b, int off, int len)
Writes specified bytes from array.
89
New cards
IOException
Exception for input/output errors.
90
New cards
System.out
Standard output stream in Java.
91
New cards
try-catch block
Handles exceptions during execution.
92
New cards
println()
Prints output to console with newline.