📄 associationservice.html
字号:
<PRE>
public <A HREF="../../../../org/jdesktop/jdic/filetypes/Association.html" title="class in org.jdesktop.jdic.filetypes">Association</A> <B>getMimeTypeAssociation</B>(java.lang.String mimeType)</PRE>
<DL>
<DD>Returns the association representing the file type of the given MIME type.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>mimeType</CODE> - a given MIME type name.<DT><B>Returns:</B><DD>the appropriate <code>Association</code> object; <code>null</code> if the given MIME type is not found in the system.</DL>
</DD>
</DL>
<HR>
<A NAME="getFileExtensionAssociation(java.lang.String)"><!-- --></A><H3>
getFileExtensionAssociation</H3>
<PRE>
public <A HREF="../../../../org/jdesktop/jdic/filetypes/Association.html" title="class in org.jdesktop.jdic.filetypes">Association</A> <B>getFileExtensionAssociation</B>(java.lang.String fileExt)</PRE>
<DL>
<DD>Returns the association representing the file type of the given file extension. <p> The file extension list in the returned <code>Association</code> object contains only this given file extension.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>fileExt</CODE> - a given file extension name.<DT><B>Returns:</B><DD>the appropriate <code>Association</code> object; <code>null</code> if the given file extension is not found in the system.</DL>
</DD>
</DL>
<HR>
<A NAME="getAssociationByContent(java.net.URL)"><!-- --></A><H3>
getAssociationByContent</H3>
<PRE>
public <A HREF="../../../../org/jdesktop/jdic/filetypes/Association.html" title="class in org.jdesktop.jdic.filetypes">Association</A> <B>getAssociationByContent</B>(java.net.URL url)</PRE>
<DL>
<DD>Returns the association representing the file type of the file the given URL points to.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>url</CODE> - a given URL.<DT><B>Returns:</B><DD>the appropriate <code>Association</code> object; <code>null</code> if the file type of the file the given URL points to is not found in the system.</DL>
</DD>
</DL>
<HR>
<A NAME="registerUserAssociation(org.jdesktop.jdic.filetypes.Association)"><!-- --></A><H3>
registerUserAssociation</H3>
<PRE>
public void <B>registerUserAssociation</B>(<A HREF="../../../../org/jdesktop/jdic/filetypes/Association.html" title="class in org.jdesktop.jdic.filetypes">Association</A> assoc) throws <A HREF="../../../../org/jdesktop/jdic/filetypes/AssociationAlreadyRegisteredException.html" title="class in org.jdesktop.jdic.filetypes">AssociationAlreadyRegisteredException</A>, <A HREF="../../../../org/jdesktop/jdic/filetypes/RegisterFailedException.html" title="class in org.jdesktop.jdic.filetypes">RegisterFailedException</A></PRE>
<DL>
<DD>Registers the given association in the user specific level. <p> <ul> <li> For Microsoft Windows platforms: the file extension list and MIME type can't both be null. If any of the description, icon file name, action list fields is not null, the file extension list couldn't be empty. <p> For Windows NT, Windows Me/98/95: the registration is always system wide, since all users share the same association information. <p> For Windows 2000 and Windows XP: the registration is only applied to this specific user. <li> For Gnome/Unix platforms: both the name and MIME type fields need to be specified to perform this operation. </ul>
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>assoc</CODE> - a given <code>Association</code> object.<DT><B>Throws:</B><DD><CODE>java.lang.IllegalArgumentException</CODE> - if the given association is not valid for this operation.<DD><CODE><A HREF="../../../../org/jdesktop/jdic/filetypes/AssociationAlreadyRegisteredException.html" title="class in org.jdesktop.jdic.filetypes">AssociationAlreadyRegisteredException</A></CODE> - if the given association already exists in the system.<DD><CODE><A HREF="../../../../org/jdesktop/jdic/filetypes/RegisterFailedException.html" title="class in org.jdesktop.jdic.filetypes">RegisterFailedException</A></CODE> - if the given association fails to be registered in the system.</DL>
</DD>
</DL>
<HR>
<A NAME="unregisterUserAssociation(org.jdesktop.jdic.filetypes.Association)"><!-- --></A><H3>
unregisterUserAssociation</H3>
<PRE>
public void <B>unregisterUserAssociation</B>(<A HREF="../../../../org/jdesktop/jdic/filetypes/Association.html" title="class in org.jdesktop.jdic.filetypes">Association</A> assoc) throws <A HREF="../../../../org/jdesktop/jdic/filetypes/AssociationNotRegisteredException.html" title="class in org.jdesktop.jdic.filetypes">AssociationNotRegisteredException</A>, <A HREF="../../../../org/jdesktop/jdic/filetypes/RegisterFailedException.html" title="class in org.jdesktop.jdic.filetypes">RegisterFailedException</A></PRE>
<DL>
<DD>Unregisters the given association in the user specific level. <p> <ul> <li> For Microsoft Windows platforms: either the MIME type or the file extension list field needs to be specified to perform this operation. <p> For Windows NT, Windows Me/98/95: the unregistration is always system wide, since all users share the same association information. <p> For Windows 2000 and Windows XP: the unregistration is only applied to this specific user. <li> For Gnome/Unix platforms: only the name field needs to be specified to perform this operation. </ul> <P>
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>assoc</CODE> - a given Association object.<DT><B>Throws:</B><DD><CODE>java.lang.IllegalArgumentException</CODE> - if the given association is not valid for this operation.<DD><CODE><A HREF="../../../../org/jdesktop/jdic/filetypes/AssociationNotRegisteredException.html" title="class in org.jdesktop.jdic.filetypes">AssociationNotRegisteredException</A></CODE> - if the given association doesn't exist in the system.<DD><CODE><A HREF="../../../../org/jdesktop/jdic/filetypes/RegisterFailedException.html" title="class in org.jdesktop.jdic.filetypes">RegisterFailedException</A></CODE> - if the given association fails to be unregistered in the system.</DL>
</DD>
</DL>
<HR>
<A NAME="registerSystemAssociation(org.jdesktop.jdic.filetypes.Association)"><!-- --></A><H3>
registerSystemAssociation</H3>
<PRE>
public void <B>registerSystemAssociation</B>(<A HREF="../../../../org/jdesktop/jdic/filetypes/Association.html" title="class in org.jdesktop.jdic.filetypes">Association</A> assoc) throws <A HREF="../../../../org/jdesktop/jdic/filetypes/AssociationAlreadyRegisteredException.html" title="class in org.jdesktop.jdic.filetypes">AssociationAlreadyRegisteredException</A>, <A HREF="../../../../org/jdesktop/jdic/filetypes/RegisterFailedException.html" title="class in org.jdesktop.jdic.filetypes">RegisterFailedException</A></PRE>
<DL>
<DD>Registers the given association in the system level. <p> <ul> <li> For Microsoft Windows platforms: the file extension list and MIME type can't all be null. If any of the description, icon file name, action list fields is not null, the file extension list couldn't be empty. <p> For Windows XP: the user needs the administrator permission to access the system association information in the registry. <li> For Gnome/Unix platforms: both the name and MIME type fields need to be specified to perform this operation. </ul>
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>assoc</CODE> - a given <code>Association</code> object.<DT><B>Throws:</B><DD><CODE>java.lang.IllegalArgumentException</CODE> - if the given association is not valid for this operation.<DD><CODE><A HREF="../../../../org/jdesktop/jdic/filetypes/AssociationAlreadyRegisteredException.html" title="class in org.jdesktop.jdic.filetypes">AssociationAlreadyRegisteredException</A></CODE> - if the given association already exists in the system.<DD><CODE><A HREF="../../../../org/jdesktop/jdic/filetypes/RegisterFailedException.html" title="class in org.jdesktop.jdic.filetypes">RegisterFailedException</A></CODE> - if the given association fails to be registered in the system.</DL>
</DD>
</DL>
<HR>
<A NAME="unregisterSystemAssociation(org.jdesktop.jdic.filetypes.Association)"><!-- --></A><H3>
unregisterSystemAssociation</H3>
<PRE>
public void <B>unregisterSystemAssociation</B>(<A HREF="../../../../org/jdesktop/jdic/filetypes/Association.html" title="class in org.jdesktop.jdic.filetypes">Association</A> assoc) throws <A HREF="../../../../org/jdesktop/jdic/filetypes/AssociationNotRegisteredException.html" title="class in org.jdesktop.jdic.filetypes">AssociationNotRegisteredException</A>, <A HREF="../../../../org/jdesktop/jdic/filetypes/RegisterFailedException.html" title="class in org.jdesktop.jdic.filetypes">RegisterFailedException</A></PRE>
<DL>
<DD>Unregisters the given association in the system level. <p> <ul> <li> For Microsoft Windows platforms: either the MIME type or the file extension list field needs to be specified to perform this operation. <p> For Windows XP: the user needs the administrator permission to access the system association information in the registry. <li> For Gnome/Unix platforms: only the name field needs to be specified to perform this operation. </ul> <P>
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>assoc</CODE> - a given Association object.<DT><B>Throws:</B><DD><CODE>java.lang.IllegalArgumentException</CODE> - if the given association is not valid for this operation.<DD><CODE><A HREF="../../../../org/jdesktop/jdic/filetypes/AssociationNotRegisteredException.html" title="class in org.jdesktop.jdic.filetypes">AssociationNotRegisteredException</A></CODE> - if the given association doesn't exist in the system.<DD><CODE><A HREF="../../../../org/jdesktop/jdic/filetypes/RegisterFailedException.html" title="class in org.jdesktop.jdic.filetypes">RegisterFailedException</A></CODE> - if the given association fails to be unregistered in the system.</DL>
</DD>
</DL>
<!-- ========= END OF CLASS DATA ========= -->
<HR>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<A NAME="navbar_bottom"><!-- --></A><A HREF="#skip-navbar_bottom" title="Skip navigation links"></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=3 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<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="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/AssociationService.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </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>
JDIC API V2006 Release 0308</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../org/jdesktop/jdic/filetypes/Association.html" title="class in org.jdesktop.jdic.filetypes"><B>PREV CLASS</B></A>
NEXT CLASS</FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../index.html" target="_top"><B>FRAMES</B></A>
<A HREF="AssociationService.html" target="_top"><B>NO FRAMES</B></A>
<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY: NESTED | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A><!-- ======== END OF BOTTOM NAVBAR ======= -->
<HR>
<font size=-1>For more information and documentation on JDIC, see <a href=https://jdic.dev.java.net>JDIC website</a>. <p>That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, working code examples, license terms and bug report information. <p>Copyright (c) 2004 Sun Microsystems, Inc. All rights reserved. Use is subject to <a href= https://jdic.dev.java.net/source/browse/jdic/src/COPYING>license terms</a>. </font>
</BODY>
</HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -