The getName() method returns the last name part of the path name of this RecordFile object. The result is formed by dropping any file system prefix there may be and every name part except the last. If the path name consists only of a name part and this is not a file system prefix, the object’s path name is returned. If the path name is empty or consists only of the file system prefix, an empty string is returned.
Special features of the DMS file system
The file system prefix is the catalog ID.
Example
Name | Result |
:JAVA:$USER.HALLO.JAVA | HALLO.JAVA |
:JAVA:HALLO.JAVA | HALLO.JAVA |
$USER.HALLO.JAVA | HALLO.JAVA |
HALLO.JAVA | HALLO.JAVA |
:JAVA:$.HALLO.JAVA | HALLO.JAVA |
:JAVA:$USER. | $USER. |
:JAVA: | empty string "" |
$USER. | $USER. |
The getParent() method returns the parent of this path name as a string, or the return value null if the path name has no parent. The parent of a path name consists of the file system prefix (if present) and of every name part, except the last, in the name sequence of the path name. If the name sequence is empty, then the path name has no parent.
Special features of the DMS file system
The file system prefix is the catalog ID.
Example
Name | Result |
:JAVA:$USER.HALLO.JAVA | :JAVA:$USER. |
:JAVA:HALLO.JAVA | :JAVA: |
$USER.HALLO.JAVA | $USER. |
HALLO.JAVA | null |
:JAVA:$.HALLO.JAVA | :JAVA:$. |
:JAVA:$USER. | :JAVA: |
:JAVA: | null |
$USER. | null |
The getParentFile() method, like the getParent() method, returns the parent of this path name, but as a RecordFile object. If the path name has no parent, null is returned.
The isAbsolute() method returns true if the path name of this RecordFile object is an absolute path name. What an absolute path name is defined on a file-system-specific basis (see section "File systems").
Example
Name | Result |
:catid:$userid. | true |
:catid:$. | true |
$userid. | false |
$. | false |
:catid: | true |
| false |
$USER.HALLO | false |
:JAVA:$.HALLO.JAVA | true |
The getAbsolutePath() method returns the absolute form of this RecordFile object’s path name as a string. If the RecordFile object was constructed with the aid of an absolute path name, this name is returned. If this is not the case, the name is supplemented on a filesystem-specific basis (see section "File systems").
Special features of the DMS file system
In DMS it may not be possible to form the absolute path name for a syntactically correct path name. For example, a file name consisting of 42 characters with a 5-character user ID is syntactically correct. However, if it is complemented by a catalog ID comprising 4 characters, a syntactically incorrect (too long) path name results.
The getAbsoluteFile() method returns the absolute form of this RecordFile object’s path name as a RecordFile object.
The getCanonicalPath() method returns the canonical form of this RecordFile object’s path name as a string. A canonical path name is both absolute and unique. The precise definition of the canonical form depends on the file system (see section "File systems").
Special features of the DMS file system
In DMS it may not be possible to form the canonical path name for a syntactically correct path name. For example, a file name consisting of 42 characters with a 4-character catalog ID is syntactically correct. However, if it is complemented by user ID comprising 5 or more characters, a syntactically incorrect (too long) path name results.
The getCanonicalFile() method returns the canonical form of this RecordFile object’s path name as a RecordFile object.
File name completion using the above methods provides the application with an insight into the structure of the file system and must therefore be monitored by an active Security Manager. In certain circumstances, file name completion is rejected with a corresponding exception (see section "Security").
The compareTo() method compares two path names lexicographically. If the two path names belong to different file systems, first of all the file system names are compared.
The equals() method compares two path names. It returns true only if the specified object is a RecordFile object which is assigned to the same file system and if the path names of both objects (in the sense of compareTo()) are equal. Equality is checked on the basis of the path names and not on the basis of the file or directory in the underlying file system, in other words if different names designate the same existing file, false is still returned.
The hashcode() method calculates a hash code from the characters of the path name and the file system name. Two RecordFile objects with the same path names and the same file system name also have the same hash code. However, two RecordFile objects with the same hash codes do not necessarily have the same path name.