Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What opaque content exactly mean?

Tags:

java

file

api

Here we have the description of isRegularFile() method of the BasicFileAttributes interface:

Tells whether the file is a regular file with opaque content.

What do they mean by "opaque content", not visible? and if so, does it mean that a file with transparent content is not a regular file? Thanks in advance.

like image 737
Rollerball Avatar asked May 12 '13 08:05

Rollerball


2 Answers

It means that under the hood, the API makes no effort to look inside the file to determine whether it really is a "regular file". A file can appear to be a regular file but might actually be encrypted, a virtual file system for some application, or any number of other things that Java doesn't know about. Java only relies on the directory entry or whatever other metadata about it is provided by the underlying operating system.

like image 159
Ted Hopp Avatar answered Oct 17 '22 04:10

Ted Hopp


I think this question better addresses the issue. Namely, in some operating systems, physical hardware devices and also "special" devices can be addressed in the same way as files are. In linux/unix, /home/interestingDocument.txt could be a file, but /dev/hda or /dev/null is usually a device and NOT a file. Other things that do exist but are not files include things like links, etc.

What is a "regular file" in Java?

like image 1
user1445967 Avatar answered Oct 17 '22 04:10

user1445967