diff options
Diffstat (limited to 'libjava/classpath/javax/activation')
20 files changed, 188 insertions, 207 deletions
diff --git a/libjava/classpath/javax/activation/ActivationDataFlavor.java b/libjava/classpath/javax/activation/ActivationDataFlavor.java index 07ba1a3..9181209 100644 --- a/libjava/classpath/javax/activation/ActivationDataFlavor.java +++ b/libjava/classpath/javax/activation/ActivationDataFlavor.java @@ -125,7 +125,7 @@ public class ActivationDataFlavor extends DataFlavor { this.humanPresentableName = humanPresentableName; } - + public boolean equals(DataFlavor dataFlavor) { return (isMimeTypeEqual(dataFlavor) && diff --git a/libjava/classpath/javax/activation/CommandInfo.java b/libjava/classpath/javax/activation/CommandInfo.java index d420c6e..c0b81e6 100644 --- a/libjava/classpath/javax/activation/CommandInfo.java +++ b/libjava/classpath/javax/activation/CommandInfo.java @@ -54,7 +54,7 @@ public class CommandInfo private final String verb; private final String className; - + /** * Constructor. * @param verb the command verb @@ -65,7 +65,7 @@ public class CommandInfo this.verb = verb; this.className = className; } - + /** * Returns the command verb. */ @@ -73,7 +73,7 @@ public class CommandInfo { return verb; } - + /** * Returns the command class name. */ @@ -81,7 +81,7 @@ public class CommandInfo { return className; } - + /** * Returns the instantiated bean. * If the bean implements <code>CommandObject</code>, its @@ -112,6 +112,5 @@ public class CommandInfo } return object; } - -} +} diff --git a/libjava/classpath/javax/activation/CommandMap.java b/libjava/classpath/javax/activation/CommandMap.java index fd74961..dbe80a9 100644 --- a/libjava/classpath/javax/activation/CommandMap.java +++ b/libjava/classpath/javax/activation/CommandMap.java @@ -39,7 +39,7 @@ package javax.activation; /** * Registry of command objects available to the system. - * + * * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a> * @version 1.1 */ @@ -47,9 +47,9 @@ public abstract class CommandMap { /* Class scope */ - + private static CommandMap defaultCommandMap; - + /** * Returns the default command map. * This returns a MailcapCommandMap if no value has been set using @@ -63,7 +63,7 @@ public abstract class CommandMap } return defaultCommandMap; } - + /** * Sets the default command map. * @param commandMap the new default command map @@ -90,19 +90,19 @@ public abstract class CommandMap } /* Instance scope */ - + /** * Returns the list of preferred commands for a MIME type. * @param mimeType the MIME type */ public abstract CommandInfo[] getPreferredCommands(String mimeType); - + /** * Returns the complete list of commands for a MIME type. * @param mimeType the MIME type */ public abstract CommandInfo[] getAllCommands(String mimeType); - + /** * Returns the command corresponding to the specified MIME type and * command name. @@ -110,13 +110,13 @@ public abstract class CommandMap * @param cmdName the command name */ public abstract CommandInfo getCommand(String mimeType, String cmdName); - + /** * Returns a DataContentHandler corresponding to the MIME type. * @param mimeType the MIME type */ public abstract DataContentHandler createDataContentHandler(String mimeType); - + /** * Get all the MIME types known to this command map. * If the command map doesn't support this operation, null is returned. @@ -127,7 +127,7 @@ public abstract class CommandMap { return null; } - + /** * Get the preferred command list from a MIME Type. The actual semantics * are determined by the implementation of the CommandMap. @@ -147,7 +147,7 @@ public abstract class CommandMap { return getPreferredCommands(mimeType); } - + /** * Get all the available commands for this type. This method * should return all the possible commands for this MIME type. @@ -166,7 +166,7 @@ public abstract class CommandMap { return getAllCommands(mimeType); } - + /** * Get the default command corresponding to the MIME type. * <p> @@ -186,7 +186,7 @@ public abstract class CommandMap { return getCommand(mimeType, cmdName); } - + /** * Locate a DataContentHandler that corresponds to the MIME type. * The mechanism and semantics for determining this are determined @@ -206,7 +206,6 @@ public abstract class CommandMap DataSource ds) { return createDataContentHandler(mimeType); - } + } } - diff --git a/libjava/classpath/javax/activation/CommandObject.java b/libjava/classpath/javax/activation/CommandObject.java index 594622d..f89a976 100644 --- a/libjava/classpath/javax/activation/CommandObject.java +++ b/libjava/classpath/javax/activation/CommandObject.java @@ -57,6 +57,5 @@ public interface CommandObject */ void setCommandContext(String verb, DataHandler dh) throws IOException; - -} +} diff --git a/libjava/classpath/javax/activation/DataContentHandler.java b/libjava/classpath/javax/activation/DataContentHandler.java index f950739..be919c2 100644 --- a/libjava/classpath/javax/activation/DataContentHandler.java +++ b/libjava/classpath/javax/activation/DataContentHandler.java @@ -56,7 +56,7 @@ public interface DataContentHandler * by preference. */ DataFlavor[] getTransferDataFlavors(); - + /** * Returns an object representing the data to be transferred. * @param df the flavor representing the requested type @@ -64,14 +64,14 @@ public interface DataContentHandler */ Object getTransferData(DataFlavor df, DataSource ds) throws UnsupportedFlavorException, IOException; - + /** * Returns an object representing the data in its most preferred form. * @param ds the data source of the data to be converted */ Object getContent(DataSource ds) throws IOException; - + /** * Writes the object as a stream of bytes. * @param obj the object to convert @@ -80,6 +80,5 @@ public interface DataContentHandler */ void writeTo(Object obj, String mimeType, OutputStream os) throws IOException; - -} +} diff --git a/libjava/classpath/javax/activation/DataContentHandlerFactory.java b/libjava/classpath/javax/activation/DataContentHandlerFactory.java index c1f2b78..815c1a9 100644 --- a/libjava/classpath/javax/activation/DataContentHandlerFactory.java +++ b/libjava/classpath/javax/activation/DataContentHandlerFactory.java @@ -51,6 +51,5 @@ public interface DataContentHandlerFactory * @param mimeType the MIME type */ DataContentHandler createDataContentHandler(String mimeType); - -} +} diff --git a/libjava/classpath/javax/activation/DataHandler.java b/libjava/classpath/javax/activation/DataHandler.java index de786f9..63ad0c4 100644 --- a/libjava/classpath/javax/activation/DataHandler.java +++ b/libjava/classpath/javax/activation/DataHandler.java @@ -59,7 +59,7 @@ public class DataHandler private static final DataFlavor[] NO_FLAVORS = new DataFlavor[0]; private static DataContentHandlerFactory factory = null; - + private final DataSource dataSource; private DataSource objDataSource; private Object object; @@ -70,7 +70,7 @@ public class DataHandler private DataContentHandler factoryDCH; private DataContentHandlerFactory oldFactory; private String shortType; - + /** * Constructor in which the data is read from a data source. * @param ds the data source @@ -80,7 +80,7 @@ public class DataHandler dataSource = ds; oldFactory = factory; } - + /** * Constructor using a reified object representation. * @param obj the object representation of the data @@ -93,7 +93,7 @@ public class DataHandler objectMimeType = mimeType; oldFactory = factory; } - + /** * Constructor in which the data is read from a URL. * @param url the URL @@ -103,7 +103,7 @@ public class DataHandler dataSource = new URLDataSource(url); oldFactory = factory; } - + /** * Returns the data source from which data is read. */ @@ -119,7 +119,7 @@ public class DataHandler } return objDataSource; } - + /** * Returns the name of the data object if created with a DataSource. */ @@ -131,7 +131,7 @@ public class DataHandler } return null; } - + /** * Returns the MIME type of the data (with parameters). */ @@ -143,7 +143,7 @@ public class DataHandler } return objectMimeType; } - + /** * Returns an input stream from which the data can be read. */ @@ -174,16 +174,16 @@ public class DataHandler thread.start(); return new PipedInputStream(pos); } - + static class DataContentHandlerWriter implements Runnable { - + DataContentHandler dch; Object object; String mimeType; OutputStream out; - + DataContentHandlerWriter(DataContentHandler dch, Object object, String mimeType, OutputStream out) { @@ -192,7 +192,7 @@ public class DataHandler this.mimeType = mimeType; this.out = out; } - + public void run() { try @@ -214,7 +214,7 @@ public class DataHandler } } } - + /** * Writes the data as a byte stream. * @param os the stream to write to @@ -238,7 +238,7 @@ public class DataHandler dch.writeTo(object, objectMimeType, os); } } - + /** * Returns an output stream that can be used to overwrite the underlying * data, if the DataSource constructor was used. @@ -252,7 +252,7 @@ public class DataHandler } return null; } - + /** * Returns the data flavors in which this data is available. */ @@ -265,7 +265,7 @@ public class DataHandler } return transferFlavors; } - + /** * Indicates whether the specified data flavor is supported for this * data. @@ -282,7 +282,7 @@ public class DataHandler } return false; } - + /** * Returns an object representing the data to be transferred. * @param flavor the requested data flavor @@ -293,7 +293,7 @@ public class DataHandler DataContentHandler dch = getDataContentHandler(); return dch.getTransferData(flavor, dataSource); } - + /** * Sets the command map to be used by this data handler. * Setting to null uses the default command map. @@ -308,7 +308,7 @@ public class DataHandler currentCommandMap = commandMap; } } - + /** * Returns the preferred commands for this type of data. */ @@ -336,7 +336,7 @@ public class DataHandler CommandMap commandMap = getCommandMap(); return commandMap.getCommand(getShortType(), cmdName); } - + /** * Returns the data as a reified object. */ @@ -346,7 +346,7 @@ public class DataHandler DataContentHandler dch = getDataContentHandler(); return dch.getContent(getDataSource()); } - + /** * Returns the instantiated bean using the specified command. * @param cmdInfo the command to instantiate the bean with @@ -399,7 +399,7 @@ public class DataHandler } factory = newFactory; } - + /* * Returns just the base part of the data's content-type, with no * parameters. @@ -421,7 +421,7 @@ public class DataHandler } return shortType; } - + /* * Returns the command map for this handler. */ @@ -433,7 +433,7 @@ public class DataHandler } return CommandMap.getDefaultCommandMap(); } - + /* * Returns the DCH for this handler. */ @@ -477,6 +477,5 @@ public class DataHandler } return dataContentHandler; } - -} +} diff --git a/libjava/classpath/javax/activation/DataHandlerDataSource.java b/libjava/classpath/javax/activation/DataHandlerDataSource.java index 8dcd1a7..9781b39 100644 --- a/libjava/classpath/javax/activation/DataHandlerDataSource.java +++ b/libjava/classpath/javax/activation/DataHandlerDataSource.java @@ -52,28 +52,28 @@ final class DataHandlerDataSource { final DataHandler dh; - + DataHandlerDataSource(DataHandler dh) { this.dh = dh; } - + public String getContentType() { return dh.getContentType(); } - + public InputStream getInputStream() throws IOException { return dh.getInputStream(); } - + public String getName() { return dh.getName(); } - + public OutputStream getOutputStream() throws IOException { @@ -81,4 +81,3 @@ final class DataHandlerDataSource } } - diff --git a/libjava/classpath/javax/activation/DataSource.java b/libjava/classpath/javax/activation/DataSource.java index 0d70843..c4da9d3 100644 --- a/libjava/classpath/javax/activation/DataSource.java +++ b/libjava/classpath/javax/activation/DataSource.java @@ -49,28 +49,27 @@ import java.io.OutputStream; */ public interface DataSource { - + /** * Returns an input stream from which the data can be read. */ InputStream getInputStream() throws IOException; - + /** * Returns an output stream to which the data can be written. */ OutputStream getOutputStream() throws IOException; - + /** * Returns the MIME content type of the data. */ String getContentType(); - + /** * Returns the underlying name of this object. */ String getName(); - -} +} diff --git a/libjava/classpath/javax/activation/DataSourceDataContentHandler.java b/libjava/classpath/javax/activation/DataSourceDataContentHandler.java index 9706ac1..8b16fd1 100644 --- a/libjava/classpath/javax/activation/DataSourceDataContentHandler.java +++ b/libjava/classpath/javax/activation/DataSourceDataContentHandler.java @@ -55,13 +55,13 @@ class DataSourceDataContentHandler private DataSource ds; private DataFlavor[] flavors; private DataContentHandler dch; - + public DataSourceDataContentHandler(DataContentHandler dch, DataSource ds) { this.ds = ds; this.dch = dch; } - + public Object getContent(DataSource ds) throws IOException { @@ -74,7 +74,7 @@ class DataSourceDataContentHandler return ds.getInputStream(); } } - + public Object getTransferData(DataFlavor flavor, DataSource ds) throws UnsupportedFlavorException, IOException { @@ -92,7 +92,7 @@ class DataSourceDataContentHandler throw new UnsupportedFlavorException(flavor); } } - + public DataFlavor[] getTransferDataFlavors() { if (flavors == null) @@ -121,6 +121,5 @@ class DataSourceDataContentHandler } dch.writeTo(obj, mimeType, out); } - -} +} diff --git a/libjava/classpath/javax/activation/FileDataSource.java b/libjava/classpath/javax/activation/FileDataSource.java index 6e9035f..72ef066 100644 --- a/libjava/classpath/javax/activation/FileDataSource.java +++ b/libjava/classpath/javax/activation/FileDataSource.java @@ -56,7 +56,7 @@ public class FileDataSource private final File file; private FileTypeMap typeMap; - + /** * Constructor. * @param file the underlying file to use @@ -65,7 +65,7 @@ public class FileDataSource { this.file = file; } - + /** * Constructor. * @param name the path to the underlying file to use @@ -74,7 +74,7 @@ public class FileDataSource { this(new File(name)); } - + public InputStream getInputStream() throws IOException { @@ -86,7 +86,7 @@ public class FileDataSource { return new FileOutputStream(file); } - + public String getContentType() { if (typeMap == null) @@ -96,12 +96,12 @@ public class FileDataSource } return typeMap.getContentType(file); } - + public String getName() { return file.getName(); } - + /** * Returns the underlying file. */ @@ -118,6 +118,5 @@ public class FileDataSource { typeMap = map; } - -} +} diff --git a/libjava/classpath/javax/activation/FileTypeMap.java b/libjava/classpath/javax/activation/FileTypeMap.java index 2ef7805..bbd088c 100644 --- a/libjava/classpath/javax/activation/FileTypeMap.java +++ b/libjava/classpath/javax/activation/FileTypeMap.java @@ -49,9 +49,9 @@ public abstract class FileTypeMap { /* Class scope */ - + private static FileTypeMap defaultMap; - + /** * Returns the system default file type map. * If one has not been set, this returns a MimetypesFileTypeMap. @@ -64,7 +64,7 @@ public abstract class FileTypeMap } return defaultMap; } - + /** * Sets the default file type map. * @param map the new file type map @@ -91,13 +91,13 @@ public abstract class FileTypeMap } /* Instance scope */ - + /** * Returns the content type of the specified file. * @param file the file to classify */ public abstract String getContentType(File file); - + /** * Returns the content type of the specified file path. * @param filename the path of the file to classify @@ -105,4 +105,3 @@ public abstract class FileTypeMap public abstract String getContentType(String filename); } - diff --git a/libjava/classpath/javax/activation/MailcapCommandMap.java b/libjava/classpath/javax/activation/MailcapCommandMap.java index cca5f04..48b1bbb 100644 --- a/libjava/classpath/javax/activation/MailcapCommandMap.java +++ b/libjava/classpath/javax/activation/MailcapCommandMap.java @@ -82,8 +82,8 @@ public class MailcapCommandMap private static boolean debug = false; private static final int NORMAL = 0; private static final int FALLBACK = 1; - - static + + static { try { @@ -94,9 +94,9 @@ public class MailcapCommandMap { } } - + private Map<String,Map<String,List<String>>>[][] mailcaps; - + /** * Default constructor. */ @@ -104,7 +104,7 @@ public class MailcapCommandMap { init(null); } - + /** * Constructor specifying a filename. * @param fileName the name of the file to read mailcap entries from @@ -132,7 +132,7 @@ public class MailcapCommandMap } } } - + /** * Constructor specifying an input stream. * @param is the input stream to read mailcap entries from @@ -150,7 +150,7 @@ public class MailcapCommandMap for (int j = 0; j < 2; j++) { mailcaps[i][j] = - new LinkedHashMap<String,Map<String,List<String>>>(); + new LinkedHashMap<String,Map<String,List<String>>>(); } } if (in != null) @@ -167,7 +167,7 @@ public class MailcapCommandMap { } } - + if (debug) { System.out.println("MailcapCommandMap: load HOME"); @@ -186,17 +186,17 @@ public class MailcapCommandMap catch (SecurityException e) { } - + if (debug) { System.out.println("MailcapCommandMap: load SYS"); } try { - parseFile(SYS, + parseFile(SYS, new CPStringBuilder(System.getProperty("java.home")) - .append(File.separatorChar) - .append("lib") + .append(File.separatorChar) + .append("lib") .append(File.separatorChar) .append("mailcap") .toString()); @@ -204,7 +204,7 @@ public class MailcapCommandMap catch (SecurityException e) { } - + if (debug) { System.out.println("MailcapCommandMap: load JAR"); @@ -253,14 +253,14 @@ public class MailcapCommandMap { parseResource(JAR, "/META-INF/mailcap"); } - + if (debug) { System.out.println("MailcapCommandMap: load DEF"); } parseResource(DEF, "/META-INF/mailcap.default"); } - + /** * Returns the list of preferred commands for a given MIME type. * @param mimeType the MIME type @@ -295,7 +295,7 @@ public class MailcapCommandMap cmdList.toArray(cmds); return cmds; } - + /** * Returns all commands for the given MIME type. * @param mimeType the MIME type @@ -343,7 +343,7 @@ public class MailcapCommandMap for (int j = 0; j < 5; j++) { Map<String,List<String>> map = - getCommands(mailcaps[j][i], mimeType); + getCommands(mailcaps[j][i], mimeType); if (map != null) { List<String> classNames = map.get(cmdName); @@ -449,7 +449,7 @@ public class MailcapCommandMap } return null; } - + /** * Get the native commands for the given MIME type. * Returns an array of strings where each string is @@ -479,8 +479,8 @@ public class MailcapCommandMap } private void addNativeCommands(List<String> acc, - Map<String,Map<String,List<String>>> mailcap, - String mimeType) + Map<String,Map<String,List<String>>> mailcap, + String mimeType) { for (Map.Entry<String,Map<String,List<String>>> mEntry : mailcap.entrySet()) { @@ -522,7 +522,7 @@ public class MailcapCommandMap } } } - + private static String nameOf(int mailcap) { switch (mailcap) @@ -539,7 +539,7 @@ public class MailcapCommandMap return "DEF"; default: return "ERR"; - } + } } private void parseFile(int index, String filename) @@ -576,7 +576,7 @@ public class MailcapCommandMap } } } - + private void parseResource(int index, String name) { Reader in = null; @@ -615,7 +615,7 @@ public class MailcapCommandMap } } } - + private void parse(int index, Reader in) throws IOException { @@ -649,7 +649,7 @@ public class MailcapCommandMap } } } - + private void parseEntry(int index, String line) { // Tokenize entry into fields @@ -691,7 +691,7 @@ public class MailcapCommandMap fallback = true; } fields.add(field); - + len = fields.size(); if (len < 2) { @@ -701,7 +701,7 @@ public class MailcapCommandMap } return; } - + Map<String,Map<String,List<String>>> mailcap = fallback ? mailcaps[index][FALLBACK] : mailcaps[index][NORMAL]; String mimeType = fields.get(0); @@ -711,9 +711,9 @@ public class MailcapCommandMap addField(mailcap, mimeType, null, (String) fields.get(i)); } } - + private void addField(Map<String,Map<String,List<String>>> mailcap, - String mimeType, String verb, String command) + String mimeType, String verb, String command) { if (verb == null) { @@ -728,7 +728,7 @@ public class MailcapCommandMap { return; // Invalid field or flag } - + Map<String,List<String>> commands = mailcap.get(mimeType); if (commands == null) { @@ -743,10 +743,10 @@ public class MailcapCommandMap } classNames.add(command); } - + private Map<String,List<String>> getCommands(Map<String,Map<String,List<String>>> mailcap, - String mimeType) + String mimeType) { int si = mimeType.indexOf('/'); String genericMimeType = new CPStringBuilder(mimeType.substring(0, si)) @@ -782,7 +782,7 @@ public class MailcapCommandMap } // -- Utility methods -- - + private List<URL> getSystemResources(String name) { List<URL> acc = new ArrayList<URL>(); @@ -799,6 +799,5 @@ public class MailcapCommandMap } return acc; } - -} +} diff --git a/libjava/classpath/javax/activation/MimeType.java b/libjava/classpath/javax/activation/MimeType.java index 70045d6..bc3afc1 100644 --- a/libjava/classpath/javax/activation/MimeType.java +++ b/libjava/classpath/javax/activation/MimeType.java @@ -53,13 +53,13 @@ import java.io.ObjectOutput; public class MimeType implements Externalizable { - + static final String TSPECIALS = "()<>@,;:/[]?=\\\""; - + private String primaryType; private String subType; private MimeTypeParameterList parameters; - + /** * Constructor for an <code>application/*</code> content type. */ @@ -69,7 +69,7 @@ public class MimeType subType = "*"; parameters = new MimeTypeParameterList(); } - + /** * Constructor that parses a raw String. * @param rawdata the MIME type string @@ -79,7 +79,7 @@ public class MimeType { parse(rawdata); } - + /** * Constructor for a new MIME type with the given primary and sub types * and an empty parameter list. @@ -103,7 +103,7 @@ public class MimeType { return primaryType; } - + /** * Sets the primary type. * @param primary the new primary type @@ -114,7 +114,7 @@ public class MimeType checkValidity(primary, "Primary type is invalid"); primaryType = primary.toLowerCase(); } - + /** * Returns the subtype. */ @@ -122,7 +122,7 @@ public class MimeType { return subType; } - + /** * Sets the subtype. * @param sub the new subtype @@ -133,7 +133,7 @@ public class MimeType checkValidity(sub, "Sub type is invalid"); subType = sub.toLowerCase(); } - + /** * Returns the MIME parameters. */ @@ -141,7 +141,7 @@ public class MimeType { return parameters; } - + /** * Returns the parameter value for the specified name. * @param name the parameter name @@ -150,7 +150,7 @@ public class MimeType { return parameters.get(name); } - + /** * Sets the parameter value for the specified name. * @param name the parameter name @@ -160,7 +160,7 @@ public class MimeType { parameters.set(name, value); } - + /** * Removes the parameter value for the specified name. * @param name the parameter name @@ -169,7 +169,7 @@ public class MimeType { parameters.remove(name); } - + /** * Returns the complete string representation of this MIME type. */ @@ -181,7 +181,7 @@ public class MimeType .append(parameters.toString()) .toString(); } - + /** * Returns the string representation of this MIME type without * parameters. @@ -193,7 +193,7 @@ public class MimeType .append(subType) .toString(); } - + /** * Returns true if the primary and subtype of this MIME type are the * same as in the given MIME type. @@ -206,7 +206,7 @@ public class MimeType "*".equals(subType) || "*".equals(sub2)); } - + /** * Returns true if the primary and subtype of this MIME type are the * same as in the given MIME type string. @@ -216,14 +216,14 @@ public class MimeType { return match(new MimeType(rawdata)); } - + public void writeExternal(ObjectOutput out) throws IOException { out.writeUTF(toString()); out.flush(); } - + public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException { @@ -236,7 +236,7 @@ public class MimeType throw new IOException(e.getMessage()); } } - + private void parse(String rawdata) throws MimeTypeParseException { @@ -283,11 +283,10 @@ public class MimeType } } } - + static boolean isValidChar(char c) { return c > ' ' && c <= '~' && TSPECIALS.indexOf(c) == -1; } } - diff --git a/libjava/classpath/javax/activation/MimeTypeParameterList.java b/libjava/classpath/javax/activation/MimeTypeParameterList.java index e15469d..3d36ede 100644 --- a/libjava/classpath/javax/activation/MimeTypeParameterList.java +++ b/libjava/classpath/javax/activation/MimeTypeParameterList.java @@ -57,7 +57,7 @@ public class MimeTypeParameterList private final List<String> parameterNames; private final Map<String,String> parameterValues; - + /** * Constructor for an empty parameter list. */ @@ -122,11 +122,11 @@ public class MimeTypeParameterList { params.add(param); } - + // Tokenize each parameter into name + value for (Iterator<String> i = params.iterator(); i.hasNext();) { - param = i.next(); + param = i.next(); int ei = param.indexOf('='); if (ei == -1) { @@ -147,12 +147,12 @@ public class MimeTypeParameterList { MimeType.checkValidity(name, "Parameter value is invalid"); } - + parameterNames.add(name); parameterValues.put(name.toLowerCase(), value); } } - + /** * Returns the number of parameters. */ @@ -160,7 +160,7 @@ public class MimeTypeParameterList { return parameterNames.size(); } - + /** * Indicates if there are no parameters. */ @@ -178,7 +178,7 @@ public class MimeTypeParameterList name = name.trim(); return parameterValues.get(name.toLowerCase()); } - + /** * Sets the value for the specified parameter name. * @param name the parameter name @@ -201,7 +201,7 @@ public class MimeTypeParameterList } parameterValues.put(name.toLowerCase(), value); } - + /** * Removes the parameter identified by the specified name. * @param name the parameter name @@ -211,7 +211,7 @@ public class MimeTypeParameterList name = name.trim(); for (Iterator<String> i = parameterNames.iterator();i.hasNext();) { - String pname = i.next(); + String pname = i.next(); if (name.equalsIgnoreCase(pname)) { i.remove(); @@ -219,7 +219,7 @@ public class MimeTypeParameterList } parameterValues.remove(name.toLowerCase()); } - + /** * Returns an enumeration of all the parameter names. */ @@ -229,7 +229,7 @@ public class MimeTypeParameterList { return new IteratorEnumeration(parameterNames.iterator()); } - + /** * Returns an RFC 2045-compliant string representation of this parameter * list. @@ -240,7 +240,7 @@ public class MimeTypeParameterList for (String name : parameterNames) { String value = parameterValues.get(name.toLowerCase()); - + buffer.append(';'); buffer.append(' '); buffer.append(name); @@ -249,7 +249,7 @@ public class MimeTypeParameterList } return buffer.toString(); } - + private static String quote(String value) { boolean needsQuoting = false; @@ -262,7 +262,7 @@ public class MimeTypeParameterList break; } } - + if (needsQuoting) { CPStringBuilder buffer = new CPStringBuilder(); @@ -281,7 +281,7 @@ public class MimeTypeParameterList } return value; } - + private static String unquote(String value) { int len = value.length(); @@ -305,32 +305,31 @@ public class MimeTypeParameterList } return buffer.toString(); } - + /** * Enumeration proxy for an Iterator. */ static class IteratorEnumeration implements Enumeration<String> { - + final Iterator<String> iterator; - + IteratorEnumeration(Iterator<String> iterator) { this.iterator = iterator; } - + public boolean hasMoreElements() { return iterator.hasNext(); } - + public String nextElement() { return iterator.next(); } - + } - -} +} diff --git a/libjava/classpath/javax/activation/MimeTypeParseException.java b/libjava/classpath/javax/activation/MimeTypeParseException.java index b46e244..18e8a62 100644 --- a/libjava/classpath/javax/activation/MimeTypeParseException.java +++ b/libjava/classpath/javax/activation/MimeTypeParseException.java @@ -55,7 +55,7 @@ public class MimeTypeParseException public MimeTypeParseException() { } - + /** * MimeTypeParseException with the specified detail message. * @param message the exception message @@ -79,6 +79,5 @@ public class MimeTypeParseException .append(token) .toString()); } - -} +} diff --git a/libjava/classpath/javax/activation/MimetypesFileTypeMap.java b/libjava/classpath/javax/activation/MimetypesFileTypeMap.java index d1566fd..0c381d8 100644 --- a/libjava/classpath/javax/activation/MimetypesFileTypeMap.java +++ b/libjava/classpath/javax/activation/MimetypesFileTypeMap.java @@ -92,9 +92,9 @@ public class MimetypesFileTypeMap { } } - + private Map<String,String>[] mimetypes; - + /** * Default constructor. */ @@ -102,7 +102,7 @@ public class MimetypesFileTypeMap { init(null); } - + /** * Constructor specifying a filename. * @param mimeTypeFileName the name of the file to read mime.types @@ -125,7 +125,7 @@ public class MimetypesFileTypeMap } } } - + /** * Constructor specifying an input stream. * @param is the input stream to read mime.types entries from @@ -156,7 +156,7 @@ public class MimetypesFileTypeMap { } } - + if (debug) { System.out.println("MimetypesFileTypeMap: load HOME"); @@ -175,7 +175,7 @@ public class MimetypesFileTypeMap catch (SecurityException e) { } - + if (debug) { System.out.println("MimetypesFileTypeMap: load SYS"); @@ -184,8 +184,8 @@ public class MimetypesFileTypeMap { parseFile(mimetypes[SYS], new CPStringBuilder(System.getProperty("java.home")) - .append(File.separatorChar) - .append("lib") + .append(File.separatorChar) + .append("lib") .append(File.separatorChar) .append("mime.types") .toString()); @@ -232,14 +232,14 @@ public class MimetypesFileTypeMap { parseResource(mimetypes[JAR], "/META-INF/mime.types"); } - + if (debug) { System.out.println("MimetypesFileTypeMap: load DEF"); } parseResource(mimetypes[DEF], "/META-INF/mimetypes.default"); } - + /** * Adds entries prorammatically to the registry. * @param mime_types a mime.types formatted entries string @@ -268,7 +268,7 @@ public class MimetypesFileTypeMap { return getContentType(f.getName()); } - + /** * Returns the MIME type based on the given filename. * If no entry is found, returns "application/octet-stream". @@ -296,7 +296,7 @@ public class MimetypesFileTypeMap } return DEFAULT_MIME_TYPE; } - + private void parseFile(Map<String,String> mimetypes, String filename) { Reader in = null; @@ -322,7 +322,7 @@ public class MimetypesFileTypeMap } } } - + private void parseResource(Map<String,String> mimetypes, String name) { Reader in = null; @@ -352,7 +352,7 @@ public class MimetypesFileTypeMap } } } - + private void parse(Map<String,String> mimetypes, Reader in) throws IOException { @@ -386,9 +386,9 @@ public class MimetypesFileTypeMap } } } - + private void parseEntry(Map<String,String> mimetypes, - String line) + String line) { // Tokenize String mimeType = null; @@ -418,9 +418,9 @@ public class MimetypesFileTypeMap mimetypes.put(buffer.toString(), mimeType); } } - + // -- Utility methods -- - + private List<URL> getSystemResources(String name) { List<URL> acc = new ArrayList<URL>(); @@ -435,6 +435,5 @@ public class MimetypesFileTypeMap } return acc; } - -} +} diff --git a/libjava/classpath/javax/activation/ObjectDataContentHandler.java b/libjava/classpath/javax/activation/ObjectDataContentHandler.java index 5105cb4..3f5e296 100644 --- a/libjava/classpath/javax/activation/ObjectDataContentHandler.java +++ b/libjava/classpath/javax/activation/ObjectDataContentHandler.java @@ -56,7 +56,7 @@ class ObjectDataContentHandler private Object object; private String mimeType; private DataFlavor[] flavors; - + public ObjectDataContentHandler(DataContentHandler dch, Object object, String mimeType) { @@ -64,12 +64,12 @@ class ObjectDataContentHandler this.object = object; this.mimeType = mimeType; } - + public Object getContent(DataSource ds) { return object; } - + public DataContentHandler getDCH() { return dch; @@ -92,7 +92,7 @@ class ObjectDataContentHandler } throw new UnsupportedFlavorException(flavor); } - + public DataFlavor[] getTransferDataFlavors() { if (flavors == null) @@ -123,6 +123,5 @@ class ObjectDataContentHandler throw new UnsupportedDataTypeException("no object DCH for MIME type " + mimeType); } } - -} +} diff --git a/libjava/classpath/javax/activation/URLDataSource.java b/libjava/classpath/javax/activation/URLDataSource.java index 8b77567..66472ad 100644 --- a/libjava/classpath/javax/activation/URLDataSource.java +++ b/libjava/classpath/javax/activation/URLDataSource.java @@ -55,7 +55,7 @@ public class URLDataSource private final URL url; private URLConnection connection; - + /** * Constructor. * This will not open the connection to the URL. @@ -64,7 +64,7 @@ public class URLDataSource { this.url = url; } - + /** * Returns the Content-Type header for the URL. * In the case of failure or lack of such a header, @@ -93,7 +93,7 @@ public class URLDataSource } return contentType; } - + /** * Returns the result of <code>getFile</code> of the underlying URL. */ @@ -101,7 +101,7 @@ public class URLDataSource { return url.getFile(); } - + public InputStream getInputStream() throws IOException { @@ -125,7 +125,7 @@ public class URLDataSource } return null; } - + /** * Returns the underlying URL. */ @@ -133,6 +133,5 @@ public class URLDataSource { return url; } - -} +} diff --git a/libjava/classpath/javax/activation/UnsupportedDataTypeException.java b/libjava/classpath/javax/activation/UnsupportedDataTypeException.java index 09460b0..d0c4b9d 100644 --- a/libjava/classpath/javax/activation/UnsupportedDataTypeException.java +++ b/libjava/classpath/javax/activation/UnsupportedDataTypeException.java @@ -55,7 +55,7 @@ public class UnsupportedDataTypeException extends IOException public UnsupportedDataTypeException() { } - + /** * Constructs an UnsupportedDataTypeException with the specified detail * message. @@ -65,6 +65,5 @@ public class UnsupportedDataTypeException extends IOException { super(message); } - -} +} |