📄 fileconnection.html
字号:
or directory is writable.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../javax/microedition/io/file/FileConnection.html#create()">create</A></B>()</CODE>
<BR>
Creates a file
corresponding to the file string provided in the Connector.open() method for
this FileConnection.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../javax/microedition/io/file/FileConnection.html#delete()">delete</A></B>()</CODE>
<BR>
Deletes the file or
directory specified in the Connector.open() URL.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> long</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../javax/microedition/io/file/FileConnection.html#directorySize(boolean)">directorySize</A></B>(boolean includeSubDirs)</CODE>
<BR>
Determines the size
in bytes on a file system of all of the files that are contained in a
directory.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../javax/microedition/io/file/FileConnection.html#exists()">exists</A></B>()</CODE>
<BR>
Checks if the file
or directory specified in the URL passed to the Connector.open() method exists.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> long</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../javax/microedition/io/file/FileConnection.html#fileSize()">fileSize</A></B>()</CODE>
<BR>
Determines the size
of a file on the file system.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../javax/microedition/io/file/FileConnection.html#getName()">getName</A></B>()</CODE>
<BR>
Returns the name of
a file or directory excluding the URL schema and all paths.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../javax/microedition/io/file/FileConnection.html#getPath()">getPath</A></B>()</CODE>
<BR>
Returns the path
excluding the file or directory name and the "file" URL schema and host from
where the file or directory specified in the Connector.open() method is opened.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../javax/microedition/io/file/FileConnection.html#getURL()">getURL</A></B>()</CODE>
<BR>
Returns the full
file URL including the scheme, host, and path from where the file or directory
specified in the Connector.open() method is opened.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../javax/microedition/io/file/FileConnection.html#isDirectory()">isDirectory</A></B>()</CODE>
<BR>
Checks if the URL
passed to the Connector.open() is a directory.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../javax/microedition/io/file/FileConnection.html#isHidden()">isHidden</A></B>()</CODE>
<BR>
Checks if the file
is hidden.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../javax/microedition/io/file/FileConnection.html#isOpen()">isOpen</A></B>()</CODE>
<BR>
Returns an
indication of whether the file connection is currently open or not.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> long</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../javax/microedition/io/file/FileConnection.html#lastModified()">lastModified</A></B>()</CODE>
<BR>
Returns the time
that the file denoted by the URL specified in the Connector.open() method was
last modified.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> java.util.Enumeration</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../javax/microedition/io/file/FileConnection.html#list()">list</A></B>()</CODE>
<BR>
Gets a list of all
visible files and directories contained in a directory.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> java.util.Enumeration</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../javax/microedition/io/file/FileConnection.html#list(java.lang.String, boolean)">list</A></B>(java.lang.String filter,
boolean includeHidden)</CODE>
<BR>
Gets a filtered
list of files and directories contained in a directory.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../javax/microedition/io/file/FileConnection.html#mkdir()">mkdir</A></B>()</CODE>
<BR>
Creates a directory
corresponding to the directory string provided in the Connector.open() method.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> java.io.DataInputStream</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../javax/microedition/io/file/FileConnection.html#openDataInputStream()">openDataInputStream</A></B>()</CODE>
<BR>
Open and return a
data input stream for a connection.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> java.io.DataOutputStream</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../javax/microedition/io/file/FileConnection.html#openDataOutputStream()">openDataOutputStream</A></B>()</CODE>
<BR>
Open and return a
data output stream for a connection.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> java.io.InputStream</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../javax/microedition/io/file/FileConnection.html#openInputStream()">openInputStream</A></B>()</CODE>
<BR>
Open and return an
input stream for a connection.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> java.io.OutputStream</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../javax/microedition/io/file/FileConnection.html#openOutputStream()">openOutputStream</A></B>()</CODE>
<BR>
Open and return an
output stream for a connection.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> java.io.OutputStream</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../javax/microedition/io/file/FileConnection.html#openOutputStream(long)">openOutputStream</A></B>(long byteOffset)</CODE>
<BR>
This method opens
an output stream and positions it at the indicated byte offset in the file.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../javax/microedition/io/file/FileConnection.html#rename(java.lang.String)">rename</A></B>(java.lang.String newName)</CODE>
<BR>
Renames the
selected file or directory to a new name in the same directory.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../javax/microedition/io/file/FileConnection.html#setFileConnection(java.lang.String)">setFileConnection</A></B>(java.lang.String fileName)</CODE>
<BR>
Resets this
FileConnection object to another file or directory.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../javax/microedition/io/file/FileConnection.html#setHidden(boolean)">setHidden</A></B>(boolean hidden)</CODE>
<BR>
Sets the hidden
attribute of the selected file to the value provided.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../javax/microedition/io/file/FileConnection.html#setReadable(boolean)">setReadable</A></B>(boolean readable)</CODE>
<BR>
Sets the file or
directory readable attribute to the indicated value.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../javax/microedition/io/file/FileConnection.html#setWritable(boolean)">setWritable</A></B>(boolean writable)</CODE>
<BR>
Sets the selected
file or directory writable attribute to the indicated value.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> long</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../javax/microedition/io/file/FileConnection.html#totalSize()">totalSize</A></B>()</CODE>
<BR>
Determines the
total size of the file system the connection's target resides on.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../javax/microedition/io/file/FileConnection.html#truncate(long)">truncate</A></B>(long byteOffset)</CODE>
<BR>
Truncates the file,
discarding all data from the given byte offset to the current end of the file.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> long</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../javax/microedition/io/file/FileConnection.html#usedSize()">usedSize</A></B>()</CODE>
<BR>
Determines the used
memory of a file system the connection's target resides on.</TD>
</TR>
</TABLE>
<A NAME="methods_inherited_from_class_javax.microedition.io.Connection"><!-- --></A>
<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#eeeeff" CLASS="TableSubHeadingColor">
<TD><B>Methods inherited from interface javax.microedition.io.Connection</B></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE>close</CODE></TD>
</TR>
</TABLE>
<P>
<!-- ============ FIELD DETAIL =========== -->
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<!-- ============ 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="isOpen()"><!-- --></A><H3>
isOpen</H3>
<PRE>
public boolean <B>isOpen</B>()</PRE>
<DL>
<DD>
Returns an indication of whether the file connection is currently open or not.
<P></P>
<DD>
<DL>
</DL>
<DD>
<DL>
<DT><B>Returns:</B><DD>true if the file connection is open, false otherwise.</DD></DL>
</DD>
</DL>
<HR>
<A NAME="openInputStream()"><!-- --></A><H3>
openInputStream</H3>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -