@@ -781,7 +781,7 @@ public boolean canWrite() {
781781 * method denies read access to the file or directory
782782 */
783783 public boolean exists () {
784- return this . path .indexOf ("!/" ) < 0 && fs ._exists (this );
784+ return path .indexOf ("!/" ) < 0 && ( fs ._exists (this ) || fs . _isDir ( this ) );
785785 }
786786
787787 /**
@@ -832,55 +832,29 @@ public boolean isFile() {
832832// }
833833// return ((fs.getBooleanAttributes(this) & FileSystem.BA_REGULAR) != 0);
834834 }
835- //
836- // /**
837- // * Tests whether the file named by this abstract pathname is a hidden
838- // * file. The exact definition of <em>hidden</em> is system-dependent. On
839- // * UNIX systems, a file is considered to be hidden if its name begins with
840- // * a period character (<code>'.'</code>). On Microsoft Windows systems, a file is
841- // * considered to be hidden if it has been marked as such in the filesystem.
842- // *
843- // * @return <code>true</code> if and only if the file denoted by this
844- // * abstract pathname is hidden according to the conventions of the
845- // * underlying platform
846- // *
847- // * @throws SecurityException
848- // * If a security manager exists and its <code>{@link
849- // * java.lang.SecurityManager#checkRead(java.lang.String)}</code>
850- // * method denies read access to the file
851- // *
852- // * @since 1.2
853- // */
854- // public boolean isHidden() {
855- // SecurityManager security = System.getSecurityManager();
856- // if (security != null) {
857- // security.checkRead(path);
858- // }
859- // return ((fs.getBooleanAttributes(this) & FileSystem.BA_HIDDEN) != 0);
860- // }
861- //
862- // /**
863- // * Returns the time that the file denoted by this abstract pathname was
864- // * last modified.
865- // *
866- // * @return A <code>long</code> value representing the time the file was
867- // * last modified, measured in milliseconds since the epoch
868- // * (00:00:00 GMT, January 1, 1970), or <code>0L</code> if the
869- // * file does not exist or if an I/O error occurs
870- // *
871- // * @throws SecurityException
872- // * If a security manager exists and its <code>{@link
873- // * java.lang.SecurityManager#checkRead(java.lang.String)}</code>
874- // * method denies read access to the file
875- // */
876- // public long lastModified() {
877- // SecurityManager security = System.getSecurityManager();
878- // if (security != null) {
879- // security.checkRead(path);
880- // }
881- // return fs.getLastModifiedTime(this);
882- // }
883- //
835+
836+ /**
837+ * Tests whether the file named by this abstract pathname is a hidden
838+ * file. The exact definition of <em>hidden</em> is system-dependent. On
839+ * UNIX systems, a file is considered to be hidden if its name begins with
840+ * a period character (<code>'.'</code>). On Microsoft Windows systems, a file is
841+ * considered to be hidden if it has been marked as such in the filesystem.
842+ *
843+ * @return <code>true</code> if and only if the file denoted by this
844+ * abstract pathname is hidden according to the conventions of the
845+ * underlying platform
846+ *
847+ * @throws SecurityException
848+ * If a security manager exists and its <code>{@link
849+ * java.lang.SecurityManager#checkRead(java.lang.String)}</code>
850+ * method denies read access to the file
851+ *
852+ * @since 1.2
853+ */
854+ public boolean isHidden () {
855+ return false ;// getName().startsWith(".");
856+ }
857+
884858 /**
885859 * Returns the length of the file denoted by this abstract pathname.
886860 * The return value is unspecified if this pathname denotes a directory.
0 commit comments