/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/** Keyed by content type, returns MimeEntries */
/** Keyed by file extension (with the .), returns MimeEntries */
// Will be reset if in the platform-specific data file
static {
"/tmp/%s");
mailcapLocations = new String[] {
};
return null;
}
});
}
MimeTable() {
load();
}
private static class DefaultInstanceHolder {
return instance;
}
});
}
}
/**
* Get the single instance of this class. First use will load the
* table from a data file.
*/
return DefaultInstanceHolder.defaultInstance;
}
/**
*
*/
return (FileNameMap)mt;
}
public synchronized int getSize() {
}
} else {
return null;
}
}
return;
}
}
}
}
if (extensionKeys != null) {
}
}
}
// try a wildcard lookup
while (e.hasMoreElements()) {
return wild;
}
}
}
return entry;
}
/**
* Locate a MimeEntry by the file extension that has been associated
* with it. Parses general file names, and URLs.
*/
if (i > 0) {
}
// REMIND: OS specific delimters appear here
}
}
/**
* Locate a MimeEntry by the file extension that has been associated
* with it.
*/
}
while (e.hasMoreElements()) {
return entry;
}
}
// We failed, now try treating description as type
return find(description);
}
return tempFileTemplate;
}
}
// For backward compatibility -- mailcap format files
// This is not currently used, but may in the future when we add ability
// to read BOTH the properties format and the mailcap format.
public synchronized void load() {
try {
// First try to load the user-specific table, if it exists
if (userTablePath != null) {
// No user-table, try to load the default built-in table.
"lib" +
}
}
else {
// No user table, try to load the default built-in table.
"lib" +
}
}
catch (IOException e) {
return;
}
}
// first, strip out the platform-specific temp file template
if (tempFileTemplate != null) {
this.tempFileTemplate = tempFileTemplate;
}
// now, parse the mime-type spec's
while (types.hasMoreElements()) {
}
}
//
// Table format:
//
// <entry> ::= <table_tag> | <type_entry>
//
// <table_tag> ::= <table_format_version> | <temp_file_template>
//
// <type_entry> ::= <type_subtype_pair> '=' <type_attrs_list>
//
// <type_subtype_pair> ::= <type> '/' <subtype>
//
// <type_attrs_list> ::= <attr_value_pair> [ ';' <attr_value_pair> ]*
// | [ <attr_value_pair> ]+
//
// <attr_value_pair> ::= <attr_name> '=' <attr_value>
//
// <attr_name> ::= 'description' | 'action' | 'application'
// | 'file_extensions' | 'icon'
//
// <attr_value> ::= <legal_char>*
//
// Embedded ';' in an <attr_value> are quoted with leading '\' .
//
// Interpretation of <attr_value> depends on the <attr_name> it is
// associated with.
//
// REMIND handle embedded ';' and '|' and literal '"'
while (tokenizer.hasMoreTokens()) {
}
}
// REMIND add exception handling...
boolean gotName = false;
while (tokenizer.hasMoreTokens()) {
if (gotName) {
}
else {
gotName = true;
}
}
}
}
}
}
}
}
// else illegal name exception
}
int n = tokenizer.countTokens();
for (int i = 0; i < n; i++) {
}
return extensions;
}
return i;
}
}
}
"lib" +
}
}
while (e.hasMoreElements()) {
}
return properties;
}
try {
}
else {
}
}
catch (IOException e) {
e.printStackTrace();
return false;
}
finally {
}
}
return true;
}
/*
* Debugging utilities
*
public void list(PrintStream out) {
Enumeration keys = entries.keys();
while (keys.hasMoreElements()) {
String key = (String)keys.nextElement();
MimeEntry entry = (MimeEntry)entries.get(key);
out.println(key + ": " + entry);
}
}
public static void main(String[] args) {
MimeTable testTable = MimeTable.getDefaultTable();
Enumeration e = testTable.elements();
while (e.hasMoreElements()) {
MimeEntry entry = (MimeEntry)e.nextElement();
System.out.println(entry);
}
testTable.save(File.separator + "tmp" +
File.separator + "mime_table.save");
}
*/
}