* config/xtensa/xtensa.md (entry): Do not emit .frame directive.
[official-gcc.git] / libjava / scripts / MakeDefaultMimeTypes.java
blob2b7aa0dbd9dc23469407cb94ea510219610d3196
1 /* Copyright (C) 2000, 2003 Free Software Foundation
3 This file is part of libgcj.
5 This software is copyrighted work licensed under the terms of the
6 Libgcj License. Please consult the file "LIBGCJ_LICENSE" for
7 details. */
9 import gnu.gcj.io.MimeTypes;
10 import java.io.IOException;
11 import java.io.FileNotFoundException;
12 import java.util.Hashtable;
13 import java.util.Enumeration;
14 import java.util.NoSuchElementException;
16 public class MakeDefaultMimeTypes
18 private static void fatal (String message)
20 System.err.println ("MakeDefaultMimeTypes Error: " + message);
21 System.exit (-1);
24 public static void main (String[] args)
26 Hashtable mime_table = new Hashtable ();
28 if (args.length != 1)
29 fatal ("missing mime type filename");
31 try {
32 MimeTypes.fillFromFile (mime_table, args[0]);
33 } catch (FileNotFoundException ex) {
34 fatal ("can't open " + args[0]);
35 } catch (IOException ex) {
36 fatal ("error reading " + args[0]);
39 System.out.println ("// Do not edit this file! Create a new version with MakeDefaultMimeTypes.\n\n/* Copyright (C) 2000 Free Software Foundation\n\n This file is part of libgcj.\n\nThis software is copyrighted work licensed under the terms of the\nLibgcj License. Please consult the file \"LIBGCJ_LICENSE\" for\ndetails. */\n\npackage gnu.gcj.io; \n\npublic class DefaultMimeTypes\n{\n public static final String[] types = {");
41 Enumeration keys = mime_table.keys();
42 Enumeration values = mime_table.elements();
44 // Prepend first element with open bracket
45 StringBuffer result = new StringBuffer("");
47 try
49 result.append(" \""
50 + keys.nextElement().toString()
51 + "\",\t\""
52 + values.nextElement().toString()
53 + "\"\n");
55 catch (NoSuchElementException ex)
59 // Prepend subsequent elements with ", "
60 try
62 while (true)
63 result.append(" , \""
64 + keys.nextElement().toString()
65 + "\",\t\""
66 + values.nextElement().toString()
67 + "\"\n");
69 catch (NoSuchElementException ex)
73 // Append last element with closing bracket
74 result.append(" };\n}\n");
75 System.out.println(result);