What are .class files




















If the target file exists and is a symbolic link, then the symbolic link itself, not the target of the link, is replaced. The exact file attributes that are copied is platform and file system dependent and therefore unspecified.

Minimally, the last-modified-time is copied to the target file if supported by both the source and target file stores. Copying of file timestamps may result in precision loss. If the file is a symbolic link, then the symbolic link itself, not the target of the link, is copied. It is implementation specific if file attributes can be copied to the new link. An implementation of this interface may support additional implementation specific options.

Copying a file is not an atomic operation. If an IOException is thrown, then it is possible that the target file is incomplete or some of its file attributes have not been copied from the source file. The check for the existence of the file and the creation of the new file may not be atomic with respect to other file system activities.

If a symbolic link is copied the security manager is invoked to check LinkPermission "symbolic". By default, this method attempts to move the file to the target file, failing if the target file exists except if the source and target are the same file, in which case this method has no effect. If the file is a symbolic link then the symbolic link itself, not the target of the link, is moved. This method may be invoked to move an empty directory.

When invoked to move a directory that is not empty then the directory is moved if it does not require moving the entries in the directory. For example, renaming a directory on the same FileStore will usually not require moving the entries in the directory.

When moving a directory requires that its entries be moved then this method fails by throwing an IOException. To move a file tree may involve copying rather than moving directories and this can be done using the copy method in conjunction with the Files. If the target file exists then it is implementation specific if the existing file is replaced or this method fails by throwing an IOException. If the move cannot be performed as an atomic file system operation then AtomicMoveNotSupportedException is thrown.

This can arise, for example, when the target location is on a different FileStore and would require that the file be copied, or target location is associated with a different provider to this object. Moving a file will copy the last-modified-time to the target file if supported by both source and target file stores. An implementation may also attempt to copy other file attributes but is not required to fail if the file attributes cannot be copied. When the move is performed as a non-atomic operation, and an IOException is thrown, then the state of the files is not defined.

The original file and the target file may both exist, the target file may be incomplete or some of its file attributes may not been copied from the original file. If the file system supports symbolic links then this method is used to read the target of the link, failing if the file is not a symbolic link.

The target of the link need not exist. The returned Path object will be associated with the same file system as link. Once a reference to the FileStore is obtained it is implementation specific if operations on the returned FileStore , or FileStoreAttributeView objects obtained from it, continue to depend on the existence of the file. In particular the behavior is not defined for the case that the file is deleted or moved to a different file store.

If both Path objects are equal then this method returns true without checking if the file exists. If the two Path objects are associated with different providers then this method returns false. Otherwise, this method checks if both Path objects locate the same file, and depending on the implementation, may require to open or access both files. If the file system and files remain static, then this method implements an equivalence relation for non-null Paths.

It is reflexive : for Path f , isSameFile f,f should return true. It is transitive : for three Paths f , g , and h , if isSameFile f,g returns true and isSameFile g,h returns true , then isSameFile f,h will return return true. See Also: BasicFileAttributes. The exact definition of hidden is platform or provider dependent. On UNIX for example a file is considered to be hidden if its name begins with a period character '. On Windows a file is considered hidden if it isn't a directory and the DOS hidden attribute is set.

Depending on the implementation this method may require to access the file system to determine if the file is considered hidden. This method uses the installed FileTypeDetector implementations to probe the given file to determine its content type. Each file type detector's probeContentType is invoked, in turn, to probe the file type. If the file is recognized then the content type is returned. If the file is not recognized by any of the installed file type detectors then a system-default file type detector is invoked to guess the content type.

A given invocation of the Java virtual machine maintains a system-wide list of file type detectors. Installed file type detectors are loaded using the service-provider loading facility defined by the ServiceLoader class. Installed file type detectors are loaded using the system class loader.

If the system class loader cannot be found then the extension class loader is used; If the extension class loader cannot be found then the bootstrap class loader is used. File type detectors are typically installed by placing them in a JAR file on the application class path or in the extension directory, the JAR file contains a provider-configuration file named java.

If the process of locating or instantiating the installed file type detectors fails then an unspecified error is thrown.

The ordering that installed providers are located is implementation specific. The string is guaranteed to be parsable according to the grammar in the RFC. A file attribute view provides a read-only or updatable view of a set of file attributes. This method is intended to be used where the file attribute view defines type-safe methods to read or update the file attributes. The type parameter is the type of the attribute view required and the method returns an instance of that type if supported.

The BasicFileAttributeView type supports access to the basic attributes of a file. Invoking this method to select a file attribute view of that type will always return an instance of that class. The options array may be used to indicate how symbolic links are handled by the resulting file attribute view for the case that the file is a symbolic link.

By default, symbolic links are followed. This option is ignored by implementations that do not support symbolic links. The type parameter is the type of the attributes required and this method returns an instance of that type if supported. All implementations support a basic set of file attributes and so invoking this method with a type parameter of BasicFileAttributes.

The options array may be used to indicate how symbolic links are handled for the case that the file is a symbolic link. By default, symbolic links are followed and the file attribute of the final target of the link is read. It is implementation specific if all file attributes are read as an atomic operation with respect to other file system operations. If this method is invoked to read security sensitive attributes then the security manager may be invoke to check for additional permissions.

The attribute parameter identifies the attribute to be set and takes the form: [ view-name : ] attribute-name where square brackets [ If not specified then it defaults to "basic" , the name of the file attribute view that identifies the basic set of file attributes common to many file systems.

By default, symbolic links are followed and the file attribute of the final target of the link is set. If this method is invoked to set security sensitive attributes then the security manager may be invoked to check for additional permissions. The attribute parameter identifies the attribute to be read and takes the form: [ view-name : ] attribute-name where square brackets [ If this method is invoked to read security sensitive attributes then the security manager may be invoked to check for additional permissions.

The attributes parameter identifies the attributes to be read and takes the form: [ view-name : ] attribute-list where square brackets [ The attribute-list component is a comma separated list of zero or more names of attributes to read. Attributes that are not supported are ignored and will not be present in the returned map.

It is implementation specific if all attributes are read as an atomic operation with respect to other file system operations. This attribute view provides access to file attributes commonly associated with files on file systems used by operating systems that implement the Portable Operating System Interface POSIX family of standards.

The path parameter is associated with a file system that supports FileOwnerAttributeView. This file attribute view provides access to a file attribute that is the owner of the file. See Also: FileSystem. Parameters: path - The path to the file Returns: true if the file is a symbolic link; false if the file does not exist, is not a symbolic link, or it cannot be determined if the file is a symbolic link or not.

Throws: SecurityException - In the case of the default provider, and a security manager is installed, its checkRead method denies read access to the file. Parameters: path - the path to the file to test options - options indicating how symbolic links are handled Returns: true if the file is a directory; false if the file does not exist, is not a directory, or it cannot be determined if the file is a directory or not.

Parameters: path - the path to the file options - options indicating how symbolic links are handled Returns: true if the file is a regular file; false if the file does not exist, is not a regular file, or it cannot be determined if the file is a regular file or not.

The file time is converted to the epoch and precision supported by the file system. Converting from finer to coarser granularities result in precision loss. The behavior of this method when attempting to set the last modified time when it is not supported by the file system or is outside the range supported by the underlying file store is not defined. It may or not fail by throwing an IOException. FileTime, java. The size may differ from the actual size on the file system due to compression, support for sparse files, or other reasons.

The size of files that are not regular files is implementation specific and therefore unspecified. The options parameter may be used to indicate how symbolic links are handled for the case that the file is a symbolic link.

Note that the result of this method is immediately outdated. If this method indicates the file exists then there is no guarantee that a subsequence access will succeed. Care should be taken when using this method in security sensitive applications. Parameters: path - the path to the file to test options - options indicating how symbolic links are handled.

Returns: true if the file exists; false if the file does not exist or its existence cannot be determined. See Also: notExists java. Path, java. This method is intended for cases where it is required to take action when it can be confirmed that a file does not exist. Note that this method is not the complement of the exists method.

Where it is not possible to determine if a file exists or not then both methods return false. As with the exists method, the result of this method is immediately outdated. If this method indicates the file does exist then there is no guarantee that a subsequence attempt to create the file will succeed. Parameters: path - the path to the file to test options - options indicating how symbolic links are handled Returns: true if the file does not exist; false if the file exists or its existence cannot be determined Throws: SecurityException - In the case of the default provider, the SecurityManager.

This method checks that a file exists and that this Java virtual machine has appropriate privileges that would allow it open the file for reading. Depending on the implementation, this method may require to read file permissions, access control lists, or other file attributes in order to check the effective access to the file.

Consequently, this method may not be atomic with respect to other file system operations. Note that the result of this method is immediately outdated, there is no guarantee that a subsequent attempt to open the file for reading will succeed or even that it will access the same file. Parameters: path - the path to the file to check Returns: true if the file exists and is readable; false if the file does not exist, read access would be denied because the Java virtual machine has insufficient privileges, or access cannot be determined Throws: SecurityException - In the case of the default provider, and a security manager is installed, the checkRead is invoked to check read access to the file.

This method checks that a file exists and that this Java virtual machine has appropriate privileges that would allow it open the file for writing. Note that result of this method is immediately outdated, there is no guarantee that a subsequent attempt to open the file for writing will succeed or even that it will access the same file.

Parameters: path - the path to the file to check Returns: true if the file exists and is writable; false if the file does not exist, write access would be denied because the Java virtual machine has insufficient privileges, or access cannot be determined Throws: SecurityException - In the case of the default provider, and a security manager is installed, the checkWrite is invoked to check write access to the file. This method checks that a file exists and that this Java virtual machine has appropriate privileges to execute the file.

The semantics may differ when checking access to a directory. For example, on UNIX systems, checking for execute access checks that the Java virtual machine has permission to search the directory in order to access file or subdirectories. Note that the result of this method is immediately outdated, there is no guarantee that a subsequent attempt to execute the file will succeed or even that it will access the same file. Parameters: path - the path to the file to check Returns: true if the file exists and is executable; false if the file does not exist, execute access would be denied because the Java virtual machine has insufficient privileges, or access cannot be determined Throws: SecurityException - In the case of the default provider, and a security manager is installed, the checkExec is invoked to check execute access to the file.

This method walks a file tree rooted at a given starting file. The file tree traversal is depth-first with the given FileVisitor invoked for each file encountered. Where a visit method terminates due an IOException , an uncaught error, or runtime exception, then the traversal is terminated and the error or exception is propagated to the caller of this method.

For each file encountered this method attempts to read its BasicFileAttributes. In members that accept a path as an input string, that path must be well-formed or an exception is raised. For example, if a path is fully qualified but begins with a space, the path is not trimmed in methods of the class. Therefore, the path is malformed and an exception is raised. Similarly, a path or a combination of paths cannot be fully qualified twice.

Ensure that your paths are well-formed when using methods that accept a path string. In members that accept a path, the path can refer to a file or just a directory. The specified path can also refer to a relative path or a Universal Naming Convention UNC path for a server and share name. For example, all the following are acceptable paths:.

Appends lines to a file, and then closes the file. If the specified file does not exist, this method creates a file, writes the specified lines to the file, and then closes the file. Appends lines to a file by using a specified encoding, and then closes the file.

Asynchronously appends lines to a file, and then closes the file. Asynchronously appends lines to a file by using a specified encoding, and then closes the file. Opens a file, appends the specified string to the file, and then closes the file. If the file does not exist, this method creates a file, writes the specified string to the file, then closes the file.

Appends the specified string to the file using the specified encoding, creating the file if it does not already exist. Asynchronously opens a file or creates a file if it does not already exist, appends the specified string to the file, and then closes the file. Asynchronously opens a file or creates the file if it does not already exist, appends the specified string to the file using the specified encoding, and then closes the file. Creates a StreamWriter that appends UTF-8 encoded text to an existing file, or to a new file if the specified file does not exist.

Creates or overwrites a file in the specified path, specifying a buffer size and options that describe how to create or overwrite the file. Creates or overwrites a file in the specified path, specifying a buffer size, options that describe how to create or overwrite the file, and a value that determines the access control and audit security for the file.

Creates a file symbolic link identified by path that points to pathToTarget. Creates or opens a file for writing UTF-8 encoded text. If the file already exists, its contents are overwritten. Decrypts a file that was encrypted by the current account using the Encrypt String method. Gets a FileSecurity object that encapsulates the access control list ACL entries for a specified file. Gets a FileSecurity object that encapsulates the specified type of access control list ACL entries for a particular file.

Gets the FileAttributes of the file on the path. Returns the creation date and time, in coordinated universal time UTC , of the specified file or directory. Returns the date and time, in coordinated universal time UTC , that the specified file or directory was last accessed. Returns the date and time, in coordinated universal time UTC , that the specified file or directory was last written to. Moves a specified file to a new location, providing the options to specify a new file name and to overwrite the destination file if it already exists.

Opens a FileStream on the specified path, with the specified mode and access with no sharing. Asynchronously opens a binary file, reads the contents of the file into a byte array, and then closes the file. Asynchronously opens a text file, reads all lines of the file with the specified encoding, and then closes the file.

Asynchronously opens a text file, reads all text in the file with the specified encoding, and then closes the file. Replaces the contents of a specified file with the contents of another file, deleting the original file, and creating a backup of the replaced file.

Replaces the contents of a specified file with the contents of another file, deleting the original file, and creating a backup of the replaced file and optionally ignores merge errors. Sets the specified FileAttributes of the file on the specified path. Sets the date and time, in coordinated universal time UTC , that the specified file was last accessed.

Sets the date and time, in coordinated universal time UTC , that the specified file was last written to. Creates a new file, writes the specified byte array to the file, and then closes the file.

If the target file already exists, it is overwritten. Asynchronously creates a new file, writes the specified byte array to the file, and then closes the file. Creates a new file by using the specified encoding, writes a collection of strings to the file, and then closes the file.

Creates a new file, writes the specified string array to the file by using the specified encoding, and then closes the file. Please let us know if you are aware of a different kind of. CLASS file. Remember, different programs may use CLASS files for different purposes, so you may need to try out a few of them to be able to open your specific file. Not sure exactly what type of file you are trying to open? Try our new File Analyzer. It is a free tool that can identify more than 11, different kinds of files - most likely yours too!

It will help you find software that can handle your specific type of file.



0コメント

  • 1000 / 1000