JCONFIG Help Document Translation - Use under the file system

xiaoxiao2021-03-06  47

The last article explains how to configure and initialize JCONFIG. This chapter mainly describes the use of JCONFIG's use.

JCONFIG allows you to get more disks, files, directory information, and let you list the contents of disks and directories. In JCONFIG, all objects are implemented in a DiskObject interface to describe disks, directories, files, and alias. The hierarchical structure is as follows: DiskObject ----- Diskvolume ----- Diskfile (Description Directory and File) --------- Diskalias (description alias) below will list these Several methods of objects

1. A number of arrays returned by the user's hard disk information fileRegistry.getvolumes () method. This array contains the currently installed hard disk information installed. You can get the information of these disks and suits their content

2. Enume the contents of the disk and directory to use the Iteerate method to implement the DiskObject interface, allow you to list the contents of the disk and directory, you can create an object that implements the method of the DiskFilter interface and passes this object Give the iTeratoE () method for the DiskObject interface. DiskFilter's Visit () method will be called as a DiskiBject object. This DiskiBject object contains the description of each object.

3. Convert java.io.file object to Jconfig DiskObject object

4. Get information about disks, directories, and files Once you have implemented a DiskiBject interface, you can get some information, such as their (disks, directories, files) creation and modify information, icon information, version information, and FinderInfo, ETC.

5. Getting Document Settings Information The data in this table is obtained from the DiskFile.GetFlags () method. And you can also use the diskfile.setflags () method. These Flags are static member variables in the DiskFile interface, and his value accounts for one byte. Diskfile flags

JConfig valueWinMacNixFILE_EXECUTABLEGG.FILE_DIR... FILE_HIDDEN ... FILE_STATIONERY ... FILE_NAME_LOCKED ... FILE_CUSTOM_ICON ... FILE_HAS_BNDL ... FILE_BEEN_INITED ... FILE_NO_INITS ... FILE_SHARED ... FILE_READONLY ... FILE_SYSTEM ... FILE_ARCHIVE .. .File_device ... file_temp ... file_sparse ... file_reparsePoint ... file_compressed ... file_offline ... file_not_content_indexed ... file_encrypted ...

Second, using an alias for an object is implementing a DiskiBject interface, you can use Java's "instanceof" keyword to determine if this object is an alias. If this object implements a Diskalias interface, he is an alias. When an object is implementing the Diskalias interface, you can decide this alias to use the FileRegistry.Resolvealias () method. You can choose whether to allow users to use it. FileRegistry.createalias () method allows you to create a separate name ...

转载请注明原文地址:https://www.9cbs.com/read-109953.html

New Post(0)