📄 package-summary.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN""http://www.w3.org/TR/REC-html40/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<TITLE>javax.microedition.io.file (FileConnection Optional Package 1.0 Spec, Final
Release) </TITLE>
<!-- Generated by javadoc on Wed Oct 29 13:12:43 PST 2003 -->
<META NAME="keywords" CONTENT="javax.microedition.io.file package">
<LINK REL="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style">
<SCRIPT>
function asd()
{
parent.document.title="javax.microedition.io.file (FileConnection Optional Package 1.0 Spec, Final Release)";
}
</SCRIPT>
</HEAD>
<BODY BGCOLOR="white" onload="asd();">
<!-- ========== START OF NAVBAR ========== -->
<A NAME="navbar_top"><!-- --></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0">
<TR>
<TD COLSPAN="3" BGCOLOR="#eeeeff" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#eeeeff" CLASS="NavBarCell1">
<A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
<TD BGCOLOR="#ffffff" CLASS="NavBarCell1Rev">
<FONT CLASS="NavBarFont1Rev"><B>Package</B></FONT> </TD>
<TD BGCOLOR="#eeeeff" CLASS="NavBarCell1">
<FONT CLASS="NavBarFont1">Class</FONT> </TD>
<TD BGCOLOR="#eeeeff" CLASS="NavBarCell1">
<A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
<TD BGCOLOR="#eeeeff" CLASS="NavBarCell1">
<A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
<TD BGCOLOR="#eeeeff" CLASS="NavBarCell1">
<A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
<TD BGCOLOR="#eeeeff" CLASS="NavBarCell1">
<A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN="3"><EM> FileConnection Optional Package 1.0<br>
Final Release</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> PREV PACKAGE
NEXT PACKAGE</FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../index.html" TARGET="_top">
<B>FRAMES</B></A> <A HREF="package-summary.html" TARGET="_top"><B>NO
FRAMES</B></A>
<SCRIPT> <!-- if(window==top) { document.writeln('<A HREF="../../../../allclasses-noframe.html" TARGET=""><B>All Classes</B></A>'); } //--></SCRIPT>
<NOSCRIPT>
<A HREF="../../../../allclasses-noframe.html" TARGET=""><B>All Classes</B></A>
</NOSCRIPT>
</FONT>
</TD>
</TR>
</TABLE>
<!-- =========== END OF NAVBAR =========== -->
<HR>
<H2>
Package javax.microedition.io.file
</H2>
This package describes file system access support based on the <code>Generic
Connection Framework</code>.
<P>
<B>See:</B>
<BR>
<A HREF="#package_description"><B>Description</B></A>
<P>
<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#ccccff" CLASS="TableHeadingColor">
<TD COLSPAN="2"><FONT SIZE="+2"> <B>Interface Summary</B></FONT></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD WIDTH="15%"><B><A HREF="FileConnection.html"><I>FileConnection</I></A></B></TD>
<TD>This interface is intended to access files or directories that are located on
removeable media and/or file systems on a device.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD WIDTH="15%"><B><A HREF="FileSystemListener.html"><I>FileSystemListener</I></A></B></TD>
<TD>This class is used for receiving status notification when adding or removing a
file system root.</TD>
</TR>
</TABLE>
<P>
<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#ccccff" CLASS="TableHeadingColor">
<TD COLSPAN="2"><FONT SIZE="+2"> <B>Class Summary</B></FONT></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD WIDTH="15%"><B><A HREF="FileSystemRegistry.html">FileSystemRegistry</A></B></TD>
<TD>The FileSystemRegistry is a central registry for file system listeners
interested in the adding and removing (or mounting and unmounting) of file
systems on a device.</TD>
</TR>
</TABLE>
<P>
<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#ccccff" CLASS="TableHeadingColor">
<TD COLSPAN="2"><FONT SIZE="+2"> <B>Exception Summary</B></FONT></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD WIDTH="15%"><B><A HREF="ConnectionClosedException.html">ConnectionClosedException</A></B></TD>
<TD>Represents an exception thrown when a method is invoked on a file connection
but the method cannot be completed because the connection is closed.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD WIDTH="15%"><B><A HREF="IllegalModeException.html">IllegalModeException</A></B></TD>
<TD>Represents an exception thrown when a method is invoked requiring a particular
security mode (e.g.</TD>
</TR>
</TABLE>
<P>
<A NAME="package_description"><!-- --></A><H2>
Package javax.microedition.io.file Description
</H2>
<P>
<p>This package describes file system access support based on the <code>Generic
Connection Framework</code>.
<H2>FileConnection URL Format</H2>
<P>The format of the input string used to access a FileConnection through<code> Connector.open()</code>
must follow the format for a fully qualified, absolute path file name as
described in the file URL format as part of IETF RFCs 1738 & 2396. That RFC
dictates that a file URL takes the form:
</P>
<code>file://<host>/<path> </code>
<P>In the form above, <host> is the fully qualified domain name of the system
on which the <path> is accessible, and <path> is a hierarchical
directory path of the form <code><root>/<directory>/<directory>/.../<name></code>.
</P>
<P>
The file connection defines the first directory as the <I>root</I>, which
corresponds to a logical mount point for a particular storage unit or memory.
Root strings are defined by the platform or implementation and can be a string
of zero or more characters (the empty string "" can be a valid root string on
some systems) followed by a trailing "/" to denote that the root is a
directory. Each root string is guaranteed to uniquely refer to a root. Root
names are device specific and are not required to adhere to any standard.
Examples of possible root strings include: Examples of possible root strings
and how to open them include:<br>
<table border="1">
<tr>
<th>
Possible Root Value</th><th>Opening a FileConnection to the Root</th></tr>
<tr>
<td>CFCard/</td>
<td>Connector.open("file:///CFCard/");</td>
</tr>
<tr>
<td>SDCard/</td>
<td>Connector.open("file:///SDCard/");</td>
</tr>
<tr>
<td>MemoryStick/</td>
<td>Connector.open("file:///MemoryStick/");</td>
</tr>
<tr>
<td>C:/</td>
<td>Connector.open("file:///C:/");</td>
</tr>
<tr>
<td>/</td>
<td>Connector.open("file:////");</td>
</tr>
</table>
<P>
The valid <i><root></i> values for a device can be retrieved by using the <code>
FileSystemRegistry.listRoots()</code> method.
</P>
<P>
The file URL must be a full absolute path file name. Relative path names
(i.e. names that contain ".." or ".") are not valid in the API except where
explicitly noted.
</P>
<h2>URL Character Format
</h2>
<p>The Java class String is to encapsulate the character string of a URI in the <code>Connector.open()</code>
method. The Java String class is capable of containing Unicode characters
and therefore the file URI may be specified using Unicode characters. </p>
<p>
However, RFC 2396 (used to define the file URI format) allows file URIs to be
expressed using an escaped ASCII format. In this scheme, Non-ASCII
characters are encoded using UTF-8 and the resulting bytes are escaped using
the "%hh" mechanism. The generic escaping mechanism and valid character
repertoire that can be presented literally are defined in the URI specification
[RFC 2396]. This canonical form of the URI is referred to in this specification
as "<b><i>escaped form</i></b>". If the escaping mechanism is not present
in the URI, the URI is said to be in "<i><b>unescaped form</b></i>".
Any occurrence of the character "%" indicates that the URI provided is in
escaped form. To specify the percent character in a URI, the escaped
character sequence of "%25" must be used.</p>
<p>All of the methods in the <code>Connector</code> class accept both escaped and
unescaped forms of file URIs as valid file specifications. All methods in
the FileConnection API that accepts any part of the file URI accepts both
escaped and unescaped forms of the input parameter unless otherwise explicitly
stated. All methods in the FileConnection API that return any part of the
file URI return the values in unescaped form unless otherwise explicitly
stated.</p>
<h2>File Separator Specification</h2>
<p>The FileConnection API returns and accepts only "/" as a file separator in File
URIs and directory names. However, a platform may use a different
separator. This separator can be retrieved via the system property
"file.separator", which is defined to contain the path separator used in the
given platform. Applications should replace the trailing "/" with the
file.separator value when presenting directories or path names in user
interfaces.</p>
<h2>File Stream Behavior</h2>
<p>
The behaviors of the methods <code>Connector.openInputStream</code>, <code>Connector.openDataInputStream</code>,
<code>Connector.openOutputStream,</code> and <code>Connector.openDataOutputStream</code>
when a "file://" parameter is specified is governed by the FileConnection
methods of the same name. In other words, <code>Connector.openXXXStream</code>
is equivalent to invoking <code>FileConnection fs = Connector.open</code> then <code>
fs.openXXXStream</code>.</p>
<p> </p>
<P>
<P>
<HR>
<!-- ========== START OF NAVBAR ========== -->
<A NAME="navbar_bottom"><!-- --></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0">
<TR>
<TD COLSPAN="3" BGCOLOR="#eeeeff" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#eeeeff" CLASS="NavBarCell1">
<A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
<TD BGCOLOR="#ffffff" CLASS="NavBarCell1Rev">
<FONT CLASS="NavBarFont1Rev"><B>Package</B></FONT> </TD>
<TD BGCOLOR="#eeeeff" CLASS="NavBarCell1">
<FONT CLASS="NavBarFont1">Class</FONT> </TD>
<TD BGCOLOR="#eeeeff" CLASS="NavBarCell1">
<A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
<TD BGCOLOR="#eeeeff" CLASS="NavBarCell1">
<A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
<TD BGCOLOR="#eeeeff" CLASS="NavBarCell1">
<A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
<TD BGCOLOR="#eeeeff" CLASS="NavBarCell1">
<A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN="3"><EM> Final Release<br>
Rev. 1.00</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> PREV PACKAGE
NEXT PACKAGE</FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../index.html" TARGET="_top">
<B>FRAMES</B></A> <A HREF="package-summary.html" TARGET="_top"><B>NO
FRAMES</B></A>
<SCRIPT> <!-- if(window==top) { document.writeln('<A HREF="../../../../allclasses-noframe.html" TARGET=""><B>All Classes</B></A>'); } //--></SCRIPT>
<NOSCRIPT>
<A HREF="../../../../allclasses-noframe.html" TARGET=""><B>All Classes</B></A>
</NOSCRIPT>
</FONT>
</TD>
</TR>
</TABLE>
<!-- =========== END OF NAVBAR =========== -->
<HR>
<font size="-1">Copyright
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -