⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 file.html

📁 API資料大全
💻 HTML
📖 第 1 页 / 共 5 页
字号:
<CODE>&nbsp;boolean</CODE></FONT></TD><TD><CODE><B><A HREF="../../java/io/File.html#setReadOnly()">setReadOnly</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Marks the file or directory named by this abstract pathname so that only read operations are allowed.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<A HREF="../../java/lang/String.html">String</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../java/io/File.html#toString()">toString</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the pathname string of this abstract pathname.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<A HREF="../../java/net/URL.html">URL</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../java/io/File.html#toURL()">toURL</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Converts this abstract pathname into a <code>file:</code> URL.</TD></TR></TABLE>&nbsp;<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"><TD><B>Methods inherited from class java.lang.<A HREF="../../java/lang/Object.html">Object</A></B></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><A HREF="../../java/lang/Object.html#clone()">clone</A>, <A HREF="../../java/lang/Object.html#finalize()">finalize</A>, <A HREF="../../java/lang/Object.html#getClass()">getClass</A>, <A HREF="../../java/lang/Object.html#notify()">notify</A>, <A HREF="../../java/lang/Object.html#notifyAll()">notifyAll</A>, <A HREF="../../java/lang/Object.html#wait()">wait</A>, <A HREF="../../java/lang/Object.html#wait(long)">wait</A>, <A HREF="../../java/lang/Object.html#wait(long, int)">wait</A></CODE></TD></TR></TABLE>&nbsp;<P><!-- ============ FIELD DETAIL =========== --><A NAME="field_detail"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=1><FONT SIZE="+2"><B>Field Detail</B></FONT></TD></TR></TABLE><A NAME="separatorChar"><!-- --></A><H3>separatorChar</H3><PRE>public static final char <B>separatorChar</B></PRE><DL><DD>The system-dependent default name-separator character.  This field is initialized to contain the first character of the value of the system property <code>file.separator</code>.  On UNIX systems the value of this field is <code>'/'</code>; on Win32 systems it is <code>'\'</code>.<DD><DL><DT><B>See Also: </B><DD><A HREF="../../java/lang/System.html#getProperty(java.lang.String)"><CODE>System.getProperty(java.lang.String)</CODE></A></DL></DD></DL><HR><A NAME="separator"><!-- --></A><H3>separator</H3><PRE>public static final <A HREF="../../java/lang/String.html">String</A> <B>separator</B></PRE><DL><DD>The system-dependent default name-separator character, represented as a string for convenience.  This string contains a single character, namely <code><A HREF="../../java/io/File.html#separatorChar"><CODE>separatorChar</CODE></A></code>.</DL><HR><A NAME="pathSeparatorChar"><!-- --></A><H3>pathSeparatorChar</H3><PRE>public static final char <B>pathSeparatorChar</B></PRE><DL><DD>The system-dependent path-separator character.  This field is initialized to contain the first character of the value of the system property <code>path.separator</code>.  This character is used to separate filenames in a sequence of files given as a <em>path list</em>. On UNIX systems, this character is <code>':'</code>; on Win32 systems it is <code>';'</code>.<DD><DL><DT><B>See Also: </B><DD><A HREF="../../java/lang/System.html#getProperty(java.lang.String)"><CODE>System.getProperty(java.lang.String)</CODE></A></DL></DD></DL><HR><A NAME="pathSeparator"><!-- --></A><H3>pathSeparator</H3><PRE>public static final <A HREF="../../java/lang/String.html">String</A> <B>pathSeparator</B></PRE><DL><DD>The system-dependent path-separator character, represented as a string for convenience.  This string contains a single character, namely <code><A HREF="../../java/io/File.html#pathSeparatorChar"><CODE>pathSeparatorChar</CODE></A></code>.</DL><!-- ========= CONSTRUCTOR DETAIL ======== --><A NAME="constructor_detail"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=1><FONT SIZE="+2"><B>Constructor Detail</B></FONT></TD></TR></TABLE><A NAME="File(java.lang.String)"><!-- --></A><H3>File</H3><PRE>public <B>File</B>(<A HREF="../../java/lang/String.html">String</A>&nbsp;pathname)</PRE><DL><DD>Creates a new <code>File</code> instance by converting the given pathname string into an abstract pathname.  If the given string is the empty string, then the result is the empty abstract pathname.<DD><DL><DT><B>Parameters:</B><DD><CODE>pathname</CODE> - A pathname string<DT><B>Throws:</B><DD><CODE><A HREF="../../java/lang/NullPointerException.html">NullPointerException</A></CODE> - If the <code>pathname</code> argument is <code>null</code></DL></DD></DL><HR><A NAME="File(java.lang.String, java.lang.String)"><!-- --></A><H3>File</H3><PRE>public <B>File</B>(<A HREF="../../java/lang/String.html">String</A>&nbsp;parent,            <A HREF="../../java/lang/String.html">String</A>&nbsp;child)</PRE><DL><DD>Creates a new <code>File</code> instance from a parent pathname string and a child pathname string. <p> If <code>parent</code> is <code>null</code> then the new <code>File</code> instance is created as if by invoking the single-argument <code>File</code> constructor on the given <code>child</code> pathname string. <p> Otherwise the <code>parent</code> pathname string is taken to denote a directory, and the <code>child</code> pathname string is taken to denote either a directory or a file.  If the <code>child</code> pathname string is absolute then it is converted into a relative pathname in a system-dependent way.  If <code>parent</code> is the empty string then the new <code>File</code> instance is created by converting <code>child</code> into an abstract pathname and resolving the result against a system-dependent default directory.  Otherwise each pathname string is converted into an abstract pathname and the child abstract pathname is resolved against the parent.<DD><DL><DT><B>Parameters:</B><DD><CODE>parent</CODE> - The parent pathname string<DD><CODE>child</CODE> - The child pathname string<DT><B>Throws:</B><DD><CODE><A HREF="../../java/lang/NullPointerException.html">NullPointerException</A></CODE> - If <code>child</code> is <code>null</code></DL></DD></DL><HR><A NAME="File(java.io.File, java.lang.String)"><!-- --></A><H3>File</H3><PRE>public <B>File</B>(<A HREF="../../java/io/File.html">File</A>&nbsp;parent,            <A HREF="../../java/lang/String.html">String</A>&nbsp;child)</PRE><DL><DD>Creates a new <code>File</code> instance from a parent abstract pathname and a child pathname string. <p> If <code>parent</code> is <code>null</code> then the new <code>File</code> instance is created as if by invoking the single-argument <code>File</code> constructor on the given <code>child</code> pathname string. <p> Otherwise the <code>parent</code> abstract pathname is taken to denote a directory, and the <code>child</code> pathname string is taken to denote either a directory or a file.  If the <code>child</code> pathname string is absolute then it is converted into a relative pathname in a system-dependent way.  If <code>parent</code> is the empty abstract pathname then the new <code>File</code> instance is created by converting <code>child</code> into an abstract pathname and resolving the result against a system-dependent default directory.  Otherwise each pathname string is converted into an abstract pathname and the child abstract pathname is resolved against the parent.<DD><DL><DT><B>Parameters:</B><DD><CODE>parent</CODE> - The parent abstract pathname<DD><CODE>child</CODE> - The child pathname string<DT><B>Throws:</B><DD><CODE><A HREF="../../java/lang/NullPointerException.html">NullPointerException</A></CODE> - If <code>child</code> is <code>null</code></DL></DD></DL><!-- ============ METHOD DETAIL ========== --><A NAME="method_detail"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=1><FONT SIZE="+2"><B>Method Detail</B></FONT></TD></TR></TABLE><A NAME="getName()"><!-- --></A><H3>getName</H3><PRE>public <A HREF="../../java/lang/String.html">String</A> <B>getName</B>()</PRE><DL><DD>Returns the name of the file or directory denoted by this abstract pathname.  This is just the last name in the pathname's name sequence.  If the pathname's name sequence is empty, then the empty string is returned.<DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>The name of the file or directory denoted by this abstract          pathname, or the empty string if this pathname's name sequence          is empty</DL></DD></DL><HR><A NAME="getParent()"><!-- --></A><H3>getParent</H3><PRE>public <A HREF="../../java/lang/String.html">String</A> <B>getParent</B>()</PRE><DL><DD>Returns the pathname string of this abstract pathname's parent, or <code>null</code> if this pathname does not name a parent directory. <p> The <em>parent</em> of an abstract pathname consists of the pathname's prefix, if any, and each name in the pathname's name sequence except for the last.  If the name sequence is empty then the pathname does not name a parent directory.<DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>The pathname string of the parent directory named by this          abstract pathname, or <code>null</code> if this pathname          does not name a parent</DL></DD></DL><HR><A NAME="getParentFile()"><!-- --></A><H3>getParentFile</H3><PRE>public <A HREF="../../java/io/File.html">File</A> <B>getParentFile</B>()</PRE><DL><DD>Returns the abstract pathname of this abstract pathname's parent, or <code>null</code> if this pathname does not name a parent directory. <p> The <em>parent</em> of an abstract pathname consists of the pathname's prefix, if any, and each name in the pathname's name sequence except for the last.  If the name sequence is empty then the pathname does not name a parent directory.<DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>The abstract pathname of the parent directory named by this          abstract pathname, or <code>null</code> if this pathname          does not name a parent<DT><B>Since: </B><DD>1.2</DD></DL></DD></DL><HR><A NAME="getPath()"><!-- --></A><H3>getPath</H3><PRE>public <A HREF="../../java/lang/String.html">String</A> <B>getPath</B>()</PRE><DL><DD>Converts this abstract pathname into a pathname string.  The resulting string uses the <A HREF="../../java/io/File.html#separator"><CODE>default name-separator character</CODE></A> to separate the names in the name sequence.<DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>The string form of this abstract pathname</DL></DD></DL><HR><A NAME="isAbsolute()"><!-- --></A><H3>isAbsolute</H3><PRE>public boolean <B>isAbsolute</B>()</PRE><DL><DD>Tests whether this abstract pathname is absolute.  The definition of absolute pathname is system dependent.  On UNIX systems, a pathname is

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -