788 lines
34 KiB
HTML
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<div class="header">
<div class="subTitle">
javax.swing.filechooser
</div>
<h2 class="title" title="Class FileSystemView">Class FileSystemView</h2>
</div><div class="contentContainer">
<ul class="inheritance">
<li><a href="../../../java/lang/Object.html" title="class in java.lang">java.lang.Object</a></li>
<li>
<ul class="inheritance">
<li>javax.swing.filechooser.FileSystemView</li>
</ul> </li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<hr/> <br/> <pre>public abstract class <span class="typeNameLabel">FileSystemView</span>
extends <a href="../../../java/lang/Object.html" title="class in java.lang">Object</a></pre>
<div class="block">
<span>FileSystemView是JFileChooser到文件系统的网关。</span>
<span>由于JDK1.1 File API不允许访问诸如根分区文件类型信息或隐藏文件位之类的信息因此该类旨在尽可能地遵循尽可能多的操作系统特定的文件系统信息。</span>
<p> <span>Java许可证持有者可能希望提供不同的FileSystemView实现来更好地处理给定的操作系统。</span> </p>
</div> </li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor.summary">
<!-- --> </a> <h3>构造方法摘要</h3>
<table border="0" cellpadding="3" cellspacing="0" class="memberSummary" summary="Constructor Summary table, listing constructors, and an explanation">
<caption>
<span>构造方法</span>
<span class="tabEnd"> </span>
</caption>
<tbody>
<tr>
<th class="colOne" scope="col">Constructor and Description</th>
</tr>
<tr class="altColor">
<td class="colOne"><code><span class="memberNameLink"><a href="../../../javax/swing/filechooser/FileSystemView.html#FileSystemView--">FileSystemView</a></span>()</code> </td>
</tr>
</tbody>
</table> </li>
</ul>
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method.summary">
<!-- --> </a> <h3>方法摘要</h3>
<table border="0" cellpadding="3" cellspacing="0" class="memberSummary" summary="Method Summary table, listing methods, and an explanation">
<caption>
<span class="activeTableTab" id="t0"><span>所有方法</span><span class="tabEnd"> </span></span>
<span class="tableTab" id="t1"><span><a href="javascript:show(1);">静态方法</a></span><span class="tabEnd"> </span></span>
<span class="tableTab" id="t2"><span><a href="javascript:show(2);">接口方法</a></span><span class="tabEnd"> </span></span>
<span class="tableTab" id="t3"><span><a href="javascript:show(4);">抽象方法</a></span><span class="tabEnd"> </span></span>
<span class="tableTab" id="t4"><span><a href="javascript:show(8);">具体的方法</a></span><span class="tabEnd"> </span></span>
</caption>
<tbody>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr class="altColor" id="i0">
<td class="colFirst"><code><a href="../../../java/io/File.html" title="class in java.io">File</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../javax/swing/filechooser/FileSystemView.html#createFileObject-java.io.File-java.lang.String-">createFileObject</a></span>(<a href="../../../java/io/File.html" title="class in java.io">File</a> dir, <a href="../../../java/lang/String.html" title="class in java.lang">String</a> filename)</code>
<div class="block">
返回从给定文件名在dir中构造的File对象。
</div> </td>
</tr>
<tr class="rowColor" id="i1">
<td class="colFirst"><code><a href="../../../java/io/File.html" title="class in java.io">File</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../javax/swing/filechooser/FileSystemView.html#createFileObject-java.lang.String-">createFileObject</a></span>(<a href="../../../java/lang/String.html" title="class in java.lang">String</a> path)</code>
<div class="block">
返回从给定的路径字符串构造的File对象。
</div> </td>
</tr>
<tr class="altColor" id="i2">
<td class="colFirst"><code>protected <a href="../../../java/io/File.html" title="class in java.io">File</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../javax/swing/filechooser/FileSystemView.html#createFileSystemRoot-java.io.File-">createFileSystemRoot</a></span>(<a href="../../../java/io/File.html" title="class in java.io">File</a> f)</code>
<div class="block">
<code>f</code>创建一个新的
<code>File</code>对象,具有文件系统根目录的正确行为。
</div> </td>
</tr>
<tr class="rowColor" id="i3">
<td class="colFirst"><code>abstract <a href="../../../java/io/File.html" title="class in java.io">File</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../javax/swing/filechooser/FileSystemView.html#createNewFolder-java.io.File-">createNewFolder</a></span>(<a href="../../../java/io/File.html" title="class in java.io">File</a> containingDir)</code>
<div class="block">
创建一个具有默认文件夹名称的新文件夹。
</div> </td>
</tr>
<tr class="altColor" id="i4">
<td class="colFirst"><code><a href="../../../java/io/File.html" title="class in java.io">File</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../javax/swing/filechooser/FileSystemView.html#getChild-java.io.File-java.lang.String-">getChild</a></span>(<a href="../../../java/io/File.html" title="class in java.io">File</a> parent, <a href="../../../java/lang/String.html" title="class in java.lang">String</a> fileName)</code> </td>
</tr>
<tr class="rowColor" id="i5">
<td class="colFirst"><code><a href="../../../java/io/File.html" title="class in java.io">File</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../javax/swing/filechooser/FileSystemView.html#getDefaultDirectory--">getDefaultDirectory</a></span>()</code>
<div class="block">
返回用户的文件选择器的默认启动目录。
</div> </td>
</tr>
<tr class="altColor" id="i6">
<td class="colFirst"><code><a href="../../../java/io/File.html" title="class in java.io">File</a>[]</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../javax/swing/filechooser/FileSystemView.html#getFiles-java.io.File-boolean-">getFiles</a></span>(<a href="../../../java/io/File.html" title="class in java.io">File</a> dir, boolean useFileHiding)</code>
<div class="block">
获取显示的列表(即
</div> </td>
</tr>
<tr class="rowColor" id="i7">
<td class="colFirst"><code>static <a href="../../../javax/swing/filechooser/FileSystemView.html" title="class in javax.swing.filechooser">FileSystemView</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../javax/swing/filechooser/FileSystemView.html#getFileSystemView--">getFileSystemView</a></span>()</code> </td>
</tr>
<tr class="altColor" id="i8">
<td class="colFirst"><code><a href="../../../java/io/File.html" title="class in java.io">File</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../javax/swing/filechooser/FileSystemView.html#getHomeDirectory--">getHomeDirectory</a></span>()</code> </td>
</tr>
<tr class="rowColor" id="i9">
<td class="colFirst"><code><a href="../../../java/io/File.html" title="class in java.io">File</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../javax/swing/filechooser/FileSystemView.html#getParentDirectory-java.io.File-">getParentDirectory</a></span>(<a href="../../../java/io/File.html" title="class in java.io">File</a> dir)</code>
<div class="block">
返回dir的父
<code>dir</code>
</div> </td>
</tr>
<tr class="altColor" id="i10">
<td class="colFirst"><code><a href="../../../java/io/File.html" title="class in java.io">File</a>[]</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../javax/swing/filechooser/FileSystemView.html#getRoots--">getRoots</a></span>()</code>
<div class="block">
返回此系统上的所有根分区。
</div> </td>
</tr>
<tr class="rowColor" id="i11">
<td class="colFirst"><code><a href="../../../java/lang/String.html" title="class in java.lang">String</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../javax/swing/filechooser/FileSystemView.html#getSystemDisplayName-java.io.File-">getSystemDisplayName</a></span>(<a href="../../../java/io/File.html" title="class in java.io">File</a> f)</code>
<div class="block">
在系统文件浏览器中显示的文件,目录或文件夹的名称。
</div> </td>
</tr>
<tr class="altColor" id="i12">
<td class="colFirst"><code><a href="../../../javax/swing/Icon.html" title="interface in javax.swing">Icon</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../javax/swing/filechooser/FileSystemView.html#getSystemIcon-java.io.File-">getSystemIcon</a></span>(<a href="../../../java/io/File.html" title="class in java.io">File</a> f)</code>
<div class="block">
文件,目录或文件夹的图标,将显示在系统文件浏览器中。
</div> </td>
</tr>
<tr class="rowColor" id="i13">
<td class="colFirst"><code><a href="../../../java/lang/String.html" title="class in java.lang">String</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../javax/swing/filechooser/FileSystemView.html#getSystemTypeDescription-java.io.File-">getSystemTypeDescription</a></span>(<a href="../../../java/io/File.html" title="class in java.io">File</a> f)</code>
<div class="block">
键入在系统文件浏览器中显示的文件,目录或文件夹的描述。
</div> </td>
</tr>
<tr class="altColor" id="i14">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../javax/swing/filechooser/FileSystemView.html#isComputerNode-java.io.File-">isComputerNode</a></span>(<a href="../../../java/io/File.html" title="class in java.io">File</a> dir)</code>
<div class="block">
由UI类用于决定是否显示计算机节点的特殊图标例如
</div> </td>
</tr>
<tr class="rowColor" id="i15">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../javax/swing/filechooser/FileSystemView.html#isDrive-java.io.File-">isDrive</a></span>(<a href="../../../java/io/File.html" title="class in java.io">File</a> dir)</code>
<div class="block">
由UI类用于决定是否显示驱动器或分区的特殊图标例如
</div> </td>
</tr>
<tr class="altColor" id="i16">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../javax/swing/filechooser/FileSystemView.html#isFileSystem-java.io.File-">isFileSystem</a></span>(<a href="../../../java/io/File.html" title="class in java.io">File</a> f)</code>
<div class="block">
检查
<code>f</code>代表一个真正的目录或文件,而不是一个特殊的文件夹,如
<code>"Desktop"</code>
</div> </td>
</tr>
<tr class="rowColor" id="i17">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../javax/swing/filechooser/FileSystemView.html#isFileSystemRoot-java.io.File-">isFileSystemRoot</a></span>(<a href="../../../java/io/File.html" title="class in java.io">File</a> dir)</code>
<div class="block">
dir是文件系统中树的根例如驱动器或分区。
</div> </td>
</tr>
<tr class="altColor" id="i18">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../javax/swing/filechooser/FileSystemView.html#isFloppyDrive-java.io.File-">isFloppyDrive</a></span>(<a href="../../../java/io/File.html" title="class in java.io">File</a> dir)</code>
<div class="block">
由UI类用于决定是否显示软盘的特殊图标。
</div> </td>
</tr>
<tr class="rowColor" id="i19">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../javax/swing/filechooser/FileSystemView.html#isHiddenFile-java.io.File-">isHiddenFile</a></span>(<a href="../../../java/io/File.html" title="class in java.io">File</a> f)</code>
<div class="block">
返回文件是否被隐藏。
</div> </td>
</tr>
<tr class="altColor" id="i20">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../javax/swing/filechooser/FileSystemView.html#isParent-java.io.File-java.io.File-">isParent</a></span>(<a href="../../../java/io/File.html" title="class in java.io">File</a> folder, <a href="../../../java/io/File.html" title="class in java.io">File</a> file)</code>
<div class="block">
在Windows上文件可以出现在多个文件夹中而不是文件系统中的父目录。
</div> </td>
</tr>
<tr class="rowColor" id="i21">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../javax/swing/filechooser/FileSystemView.html#isRoot-java.io.File-">isRoot</a></span>(<a href="../../../java/io/File.html" title="class in java.io">File</a> f)</code>
<div class="block">
确定给定文件是否是可导航树中的根。
</div> </td>
</tr>
<tr class="altColor" id="i22">
<td class="colFirst"><code><a href="../../../java/lang/Boolean.html" title="class in java.lang">Boolean</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../javax/swing/filechooser/FileSystemView.html#isTraversable-java.io.File-">isTraversable</a></span>(<a href="../../../java/io/File.html" title="class in java.io">File</a> f)</code>
<div class="block">
如果可以访问文件目录则返回true。
</div> </td>
</tr>
</tbody>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods.inherited.from.class.java.lang.Object">
<!-- --> </a> <h3>Methods inherited from class java.lang.<a href="../../../java/lang/Object.html" title="class in java.lang">Object</a></h3> <code><a href="../../../java/lang/Object.html#clone--">clone</a>, <a href="../../../java/lang/Object.html#equals-java.lang.Object-">equals</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#hashCode--">hashCode</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#toString--">toString</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></li>
</ul> </li>
</ul> </li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor.detail">
<!-- --> </a> <h3>构造方法详细信息</h3> <a name="FileSystemView--">
<!-- --> </a>
<ul class="blockListLast">
<li class="blockList"> <h4>FileSystemView</h4> <pre>public FileSystemView()</pre> </li>
</ul> </li>
</ul>
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method.detail">
<!-- --> </a> <h3>方法详细信息</h3> <a name="getFileSystemView--">
<!-- --> </a>
<ul class="blockList">
<li class="blockList"> <h4>getFileSystemView</h4> <pre>public static <a href="../../../javax/swing/filechooser/FileSystemView.html" title="class in javax.swing.filechooser">FileSystemView</a> getFileSystemView()</pre> </li>
</ul> <a name="isRoot-java.io.File-">
<!-- --> </a>
<ul class="blockList">
<li class="blockList"> <h4>isRoot</h4> <pre>public boolean isRoot(<a href="../../../java/io/File.html" title="class in java.io">File</a> f)</pre>
<div class="block">
<span>确定给定文件是否是可导航树中的根。</span>
<span>示例Windows 98有一个根桌面文件夹。</span>
<span>DOS每个驱动器号有一个根 <code>C:\</code><code>D:\</code>有一个根, <code>"/"</code>目录。</span>
<span>默认实现从<code>ShellFolder</code>类获取信息。</span>
</div>
<dl>
<dt>
<span class="paramLabel">参数</span>
</dt>
<dd>
<code>f</code> - 一个表示
<code>File</code>对象
</dd>
<dt>
<span class="returnLabel">结果</span>
</dt>
<dd>
<code>true</code>如果
<code>f</code>是可导航树中的根。
</dd>
<dt>
<span class="seeLabel">另请参见:</span>
</dt>
<dd>
<a href="../../../javax/swing/filechooser/FileSystemView.html#isFileSystemRoot-java.io.File-"><code>isFileSystemRoot(java.io.File)</code></a>
</dd>
</dl> </li>
</ul> <a name="isTraversable-java.io.File-">
<!-- --> </a>
<ul class="blockList">
<li class="blockList"> <h4>isTraversable</h4> <pre>public <a href="../../../java/lang/Boolean.html" title="class in java.lang">Boolean</a> isTraversable(<a href="../../../java/io/File.html" title="class in java.io">File</a> f)</pre>
<div class="block">
<span>如果可以访问文件目录则返回true。</span>
<span>如果目录无法遍历返回false。</span>
</div>
<dl>
<dt>
<span class="paramLabel">参数</span>
</dt>
<dd>
<code>f</code> -
<code>File</code>
</dd>
<dt>
<span class="returnLabel">结果</span>
</dt>
<dd>
<code>true</code>如果文件/目录可以遍历,否则
<code>false</code>
</dd>
<dt>
<span class="simpleTagLabel">从以下版本开始:</span>
</dt>
<dd>
1.4
</dd>
<dt>
<span class="seeLabel">另请参见:</span>
</dt>
<dd>
<a href="../../../javax/swing/JFileChooser.html#isTraversable-java.io.File-"><code>JFileChooser.isTraversable(java.io.File)</code></a>
<a href="../../../javax/swing/filechooser/FileView.html#isTraversable-java.io.File-"><code>FileView.isTraversable(java.io.File)</code></a>
</dd>
</dl> </li>
</ul> <a name="getSystemDisplayName-java.io.File-">
<!-- --> </a>
<ul class="blockList">
<li class="blockList"> <h4>getSystemDisplayName</h4> <pre>public <a href="../../../java/lang/String.html" title="class in java.lang">String</a> getSystemDisplayName(<a href="../../../java/io/File.html" title="class in java.io">File</a> f)</pre>
<div class="block">
<span>在系统文件浏览器中显示的文件,目录或文件夹的名称。</span>
<span>Windows中的示例“M\”目录显示为“CD-ROMM :)”默认实现从ShellFolder类获取信息。</span>
</div>
<dl>
<dt>
<span class="paramLabel">参数</span>
</dt>
<dd>
<code>f</code> - 一个
<code>File</code>对象
</dd>
<dt>
<span class="returnLabel">结果</span>
</dt>
<dd>
由本机文件选择器显示的文件名
</dd>
<dt>
<span class="simpleTagLabel">从以下版本开始:</span>
</dt>
<dd>
1.4
</dd>
<dt>
<span class="seeLabel">另请参见:</span>
</dt>
<dd>
<a href="../../../javax/swing/JFileChooser.html#getName-java.io.File-"><code>JFileChooser.getName(java.io.File)</code></a>
</dd>
</dl> </li>
</ul> <a name="getSystemTypeDescription-java.io.File-">
<!-- --> </a>
<ul class="blockList">
<li class="blockList"> <h4>getSystemTypeDescription</h4> <pre>public <a href="../../../java/lang/String.html" title="class in java.lang">String</a> getSystemTypeDescription(<a href="../../../java/io/File.html" title="class in java.io">File</a> f)</pre>
<div class="block">
<span>键入在系统文件浏览器中显示的文件,目录或文件夹的描述。</span>
<span>Windows中的示例“桌面”文件夹被描述为“桌面”。</span>
<span>覆盖使用本机ShellFolder实现的平台。</span>
</div>
<dl>
<dt>
<span class="paramLabel">参数</span>
</dt>
<dd>
<code>f</code> - 一个
<code>File</code>对象
</dd>
<dt>
<span class="returnLabel">结果</span>
</dt>
<dd>
文件类型描述,由本机文件选择器显示,如果没有本机信息可用,则为空。
</dd>
<dt>
<span class="simpleTagLabel">从以下版本开始:</span>
</dt>
<dd>
1.4
</dd>
<dt>
<span class="seeLabel">另请参见:</span>
</dt>
<dd>
<a href="../../../javax/swing/JFileChooser.html#getTypeDescription-java.io.File-"><code>JFileChooser.getTypeDescription(java.io.File)</code></a>
</dd>
</dl> </li>
</ul> <a name="getSystemIcon-java.io.File-">
<!-- --> </a>
<ul class="blockList">
<li class="blockList"> <h4>getSystemIcon</h4> <pre>public <a href="../../../javax/swing/Icon.html" title="interface in javax.swing">Icon</a> getSystemIcon(<a href="../../../java/io/File.html" title="class in java.io">File</a> f)</pre>
<div class="block">
<span>文件,目录或文件夹的图标,将显示在系统文件浏览器中。</span>
<span>Windows中的示例“M\”目录显示CD-ROM图标。</span>
<span>默认实现从ShellFolder类获取信息。</span>
</div>
<dl>
<dt>
<span class="paramLabel">参数</span>
</dt>
<dd>
<code>f</code> - 一个
<code>File</code>对象
</dd>
<dt>
<span class="returnLabel">结果</span>
</dt>
<dd>
一个图标,它将由本机文件选择器显示
</dd>
<dt>
<span class="simpleTagLabel">从以下版本开始:</span>
</dt>
<dd>
1.4
</dd>
<dt>
<span class="seeLabel">另请参见:</span>
</dt>
<dd>
<a href="../../../javax/swing/JFileChooser.html#getIcon-java.io.File-"><code>JFileChooser.getIcon(java.io.File)</code></a>
</dd>
</dl> </li>
</ul> <a name="isParent-java.io.File-java.io.File-">
<!-- --> </a>
<ul class="blockList">
<li class="blockList"> <h4>isParent</h4> <pre>public boolean isParent(<a href="../../../java/io/File.html" title="class in java.io">File</a> folder,
<a href="../../../java/io/File.html" title="class in java.io">File</a> file)</pre>
<div class="block">
<span>在Windows上文件可以出现在多个文件夹中而不是文件系统中的父目录。</span>
<span>文件夹可以是“desktop”文件夹它与file.getParentFile不一样。</span>
</div>
<dl>
<dt>
<span class="paramLabel">参数</span>
</dt>
<dd>
<code>folder</code> - 一个表示目录或特殊文件夹的
<code>File</code>对象
</dd>
<dd>
<code>file</code> - 一个
<code>File</code>对象
</dd>
<dt>
<span class="returnLabel">结果</span>
</dt>
<dd>
<code>true</code>如果
<code>folder</code>是一个目录或特殊文件夹,并且包含
<code>file</code>
</dd>
<dt>
<span class="simpleTagLabel">从以下版本开始:</span>
</dt>
<dd>
1.4
</dd>
</dl> </li>
</ul> <a name="getChild-java.io.File-java.lang.String-">
<!-- --> </a>
<ul class="blockList">
<li class="blockList"> <h4>getChild</h4> <pre>public <a href="../../../java/io/File.html" title="class in java.io">File</a> getChild(<a href="../../../java/io/File.html" title="class in java.io">File</a> parent,
<a href="../../../java/lang/String.html" title="class in java.lang">String</a> fileName)</pre>
<dl>
<dt>
<span class="paramLabel">参数</span>
</dt>
<dd>
<code>parent</code> - 一个表示目录或特殊文件夹的
<code>File</code>对象
</dd>
<dd>
<code>fileName</code> - 存在于
<code>parent</code>中的文件或文件夹的名称
</dd>
<dt>
<span class="returnLabel">结果</span>
</dt>
<dd>
<span>一个File对象。</span>
<span>这通常是用<code>new File(parent, fileName)</code>除了父和子都是特殊文件夹,在这种情况下, <code>File</code>是一个包含<code>ShellFolder</code>对象的包装器。</span>
</dd>
<dt>
<span class="simpleTagLabel">从以下版本开始:</span>
</dt>
<dd>
1.4
</dd>
</dl> </li>
</ul> <a name="isFileSystem-java.io.File-">
<!-- --> </a>
<ul class="blockList">
<li class="blockList"> <h4>isFileSystem</h4> <pre>public boolean isFileSystem(<a href="../../../java/io/File.html" title="class in java.io">File</a> f)</pre>
<div class="block">
<span>检查<code>f</code>代表一个真正的目录或文件,而不是一个特殊的文件夹,如<code>"Desktop"</code></span>
<span>由UI类用来决定在选择目录时是否可以选择文件夹。</span>
</div>
<dl>
<dt>
<span class="paramLabel">参数</span>
</dt>
<dd>
<code>f</code> - 一个
<code>File</code>对象
</dd>
<dt>
<span class="returnLabel">结果</span>
</dt>
<dd>
<code>true</code>如果
<code>f</code>是一个真实的文件或目录。
</dd>
<dt>
<span class="simpleTagLabel">从以下版本开始:</span>
</dt>
<dd>
1.4
</dd>
</dl> </li>
</ul> <a name="createNewFolder-java.io.File-">
<!-- --> </a>
<ul class="blockList">
<li class="blockList"> <h4>createNewFolder</h4> <pre>public abstract <a href="../../../java/io/File.html" title="class in java.io">File</a> createNewFolder(<a href="../../../java/io/File.html" title="class in java.io">File</a> containingDir)
throws <a href="../../../java/io/IOException.html" title="class in java.io">IOException</a></pre>
<div class="block">
创建一个具有默认文件夹名称的新文件夹。
</div>
<dl>
<dt>
<span class="throwsLabel">异常</span>
</dt>
<dd>
<code><a href="../../../java/io/IOException.html" title="class in java.io">IOException</a></code>
</dd>
</dl> </li>
</ul> <a name="isHiddenFile-java.io.File-">
<!-- --> </a>
<ul class="blockList">
<li class="blockList"> <h4>isHiddenFile</h4> <pre>public boolean isHiddenFile(<a href="../../../java/io/File.html" title="class in java.io">File</a> f)</pre>
<div class="block">
返回文件是否被隐藏。
</div> </li>
</ul> <a name="isFileSystemRoot-java.io.File-">
<!-- --> </a>
<ul class="blockList">
<li class="blockList"> <h4>isFileSystemRoot</h4> <pre>public boolean isFileSystemRoot(<a href="../../../java/io/File.html" title="class in java.io">File</a> dir)</pre>
<div class="block">
<span>dir是文件系统中树的根例如驱动器或分区。</span>
<span>示例在Windows 98上为“C\”返回true。</span>
</div>
<dl>
<dt>
<span class="paramLabel">参数</span>
</dt>
<dd>
<code>dir</code> - 表示
<code>File</code>对象
</dd>
<dt>
<span class="returnLabel">结果</span>
</dt>
<dd>
<code>true</code>如果
<code>f</code>是文件系统的根
</dd>
<dt>
<span class="simpleTagLabel">从以下版本开始:</span>
</dt>
<dd>
1.4
</dd>
<dt>
<span class="seeLabel">另请参见:</span>
</dt>
<dd>
<a href="../../../javax/swing/filechooser/FileSystemView.html#isRoot-java.io.File-"><code>isRoot(java.io.File)</code></a>
</dd>
</dl> </li>
</ul> <a name="isDrive-java.io.File-">
<!-- --> </a>
<ul class="blockList">
<li class="blockList"> <h4>isDrive</h4> <pre>public boolean isDrive(<a href="../../../java/io/File.html" title="class in java.io">File</a> dir)</pre>
<div class="block">
<span>由UI类用于决定是否显示驱动器或分区的特殊图标例如“硬盘”图标。</span>
<span>默认实现无法知道所以总是返回false。</span>
</div>
<dl>
<dt>
<span class="paramLabel">参数</span>
</dt>
<dd>
<code>dir</code> - 一个目录
</dd>
<dt>
<span class="returnLabel">结果</span>
</dt>
<dd>
总是
<code>false</code>
</dd>
<dt>
<span class="simpleTagLabel">从以下版本开始:</span>
</dt>
<dd>
1.4
</dd>
</dl> </li>
</ul> <a name="isFloppyDrive-java.io.File-">
<!-- --> </a>
<ul class="blockList">
<li class="blockList"> <h4>isFloppyDrive</h4> <pre>public boolean isFloppyDrive(<a href="../../../java/io/File.html" title="class in java.io">File</a> dir)</pre>
<div class="block">
<span>由UI类用于决定是否显示软盘的特殊图标。</span>
<span>Implies isDrivedir</span>
<span>默认实现无法知道所以总是返回false。</span>
</div>
<dl>
<dt>
<span class="paramLabel">参数</span>
</dt>
<dd>
<code>dir</code> - 一个目录
</dd>
<dt>
<span class="returnLabel">结果</span>
</dt>
<dd>
<code>false</code>总是
</dd>
<dt>
<span class="simpleTagLabel">从以下版本开始:</span>
</dt>
<dd>
1.4
</dd>
</dl> </li>
</ul> <a name="isComputerNode-java.io.File-">
<!-- --> </a>
<ul class="blockList">
<li class="blockList"> <h4>isComputerNode</h4> <pre>public boolean isComputerNode(<a href="../../../java/io/File.html" title="class in java.io">File</a> dir)</pre>
<div class="block">
<span>由UI类用于决定是否显示计算机节点的特殊图标例如“我的电脑”或网络服务器。</span>
<span>默认实现无法知道所以总是返回false。</span>
</div>
<dl>
<dt>
<span class="paramLabel">参数</span>
</dt>
<dd>
<code>dir</code> - 一个目录
</dd>
<dt>
<span class="returnLabel">结果</span>
</dt>
<dd>
<code>false</code>总是
</dd>
<dt>
<span class="simpleTagLabel">从以下版本开始:</span>
</dt>
<dd>
1.4
</dd>
</dl> </li>
</ul> <a name="getRoots--">
<!-- --> </a>
<ul class="blockList">
<li class="blockList"> <h4>getRoots</h4> <pre>public <a href="../../../java/io/File.html" title="class in java.io">File</a>[] getRoots()</pre>
<div class="block">
<span>返回此系统上的所有根分区。</span>
<span>例如在Windows上这将是“桌面”文件夹而在DOS上这将是A通过Z驱动器。</span>
</div> </li>
</ul> <a name="getHomeDirectory--">
<!-- --> </a>
<ul class="blockList">
<li class="blockList"> <h4>getHomeDirectory</h4> <pre>public <a href="../../../java/io/File.html" title="class in java.io">File</a> getHomeDirectory()</pre> </li>
</ul> <a name="getDefaultDirectory--">
<!-- --> </a>
<ul class="blockList">
<li class="blockList"> <h4>getDefaultDirectory</h4> <pre>public <a href="../../../java/io/File.html" title="class in java.io">File</a> getDefaultDirectory()</pre>
<div class="block">
返回用户的文件选择器的默认启动目录。
</div>
<dl>
<dt>
<span class="returnLabel">结果</span>
</dt>
<dd>
一个
<code>File</code>默认起始文件夹的
<code>File</code>对象
</dd>
<dt>
<span class="simpleTagLabel">从以下版本开始:</span>
</dt>
<dd>
1.4
</dd>
</dl> </li>
</ul> <a name="createFileObject-java.io.File-java.lang.String-">
<!-- --> </a>
<ul class="blockList">
<li class="blockList"> <h4>createFileObject</h4> <pre>public <a href="../../../java/io/File.html" title="class in java.io">File</a> createFileObject(<a href="../../../java/io/File.html" title="class in java.io">File</a> dir,
<a href="../../../java/lang/String.html" title="class in java.lang">String</a> filename)</pre>
<div class="block">
返回从给定文件名在dir中构造的File对象。
</div> </li>
</ul> <a name="createFileObject-java.lang.String-">
<!-- --> </a>
<ul class="blockList">
<li class="blockList"> <h4>createFileObject</h4> <pre>public <a href="../../../java/io/File.html" title="class in java.io">File</a> createFileObject(<a href="../../../java/lang/String.html" title="class in java.lang">String</a> path)</pre>
<div class="block">
返回从给定的路径字符串构造的File对象。
</div> </li>
</ul> <a name="getFiles-java.io.File-boolean-">
<!-- --> </a>
<ul class="blockList">
<li class="blockList"> <h4>getFiles</h4> <pre>public <a href="../../../java/io/File.html" title="class in java.io">File</a>[] getFiles(<a href="../../../java/io/File.html" title="class in java.io">File</a> dir,
boolean useFileHiding)</pre>
<div class="block">
获取显示的列表(即不隐藏)文件。
</div> </li>
</ul> <a name="getParentDirectory-java.io.File-">
<!-- --> </a>
<ul class="blockList">
<li class="blockList"> <h4>getParentDirectory</h4> <pre>public <a href="../../../java/io/File.html" title="class in java.io">File</a> getParentDirectory(<a href="../../../java/io/File.html" title="class in java.io">File</a> dir)</pre>
<div class="block">
返回dir的父
<code>dir</code>
</div>
<dl>
<dt>
<span class="paramLabel">参数</span>
</dt>
<dd>
<code>dir</code> - 被查询的
<code>File</code>
</dd>
<dt>
<span class="returnLabel">结果</span>
</dt>
<dd>
父目录为
<code>dir</code> ,或
<code>null</code>如果
<code>dir</code>
<code>null</code>
</dd>
</dl> </li>
</ul> <a name="createFileSystemRoot-java.io.File-">
<!-- --> </a>
<ul class="blockListLast">
<li class="blockList"> <h4>createFileSystemRoot</h4> <pre>protected <a href="../../../java/io/File.html" title="class in java.io">File</a> createFileSystemRoot(<a href="../../../java/io/File.html" title="class in java.io">File</a> f)</pre>
<div class="block">
<code>f</code>创建一个新的
<code>File</code>对象,具有文件系统根目录的正确行为。
</div>
<dl>
<dt>
<span class="paramLabel">参数</span>
</dt>
<dd>
<code>f</code> - 表示文件系统根目录的
<code>File</code>对象例如Unix上的“/”或Windows上的“C\”。
</dd>
<dt>
<span class="returnLabel">结果</span>
</dt>
<dd>
一个新的
<code>File</code>对象
</dd>
<dt>
<span class="simpleTagLabel">从以下版本开始:</span>
</dt>
<dd>
1.4
</dd>
</dl> </li>
</ul> </li>
</ul> </li>
</ul>
</div>
</div>