Imported GNU Classpath 0.92
2006-08-14 Mark Wielaard <mark@klomp.org> Imported GNU Classpath 0.92 * HACKING: Add more importing hints. Update automake version requirement. * configure.ac (gconf-peer): New enable AC argument. Add --disable-gconf-peer and --enable-default-preferences-peer to classpath configure when gconf is disabled. * scripts/makemake.tcl: Set gnu/java/util/prefs/gconf and gnu/java/awt/dnd/peer/gtk to bc. Classify gnu/java/security/Configuration.java as generated source file. * gnu/java/lang/management/VMGarbageCollectorMXBeanImpl.java, gnu/java/lang/management/VMMemoryPoolMXBeanImpl.java, gnu/java/lang/management/VMClassLoadingMXBeanImpl.java, gnu/java/lang/management/VMRuntimeMXBeanImpl.java, gnu/java/lang/management/VMMemoryManagerMXBeanImpl.java, gnu/java/lang/management/VMThreadMXBeanImpl.java, gnu/java/lang/management/VMMemoryMXBeanImpl.java, gnu/java/lang/management/VMCompilationMXBeanImpl.java: New VM stub classes. * java/lang/management/VMManagementFactory.java: Likewise. * java/net/VMURLConnection.java: Likewise. * gnu/java/nio/VMChannel.java: Likewise. * java/lang/Thread.java (getState): Add stub implementation. * java/lang/Class.java (isEnum): Likewise. * java/lang/Class.h (isEnum): Likewise. * gnu/awt/xlib/XToolkit.java (getClasspathTextLayoutPeer): Removed. * javax/naming/spi/NamingManager.java: New override for StackWalker functionality. * configure, sources.am, Makefile.in, gcj/Makefile.in, include/Makefile.in, testsuite/Makefile.in: Regenerated. From-SVN: r116139
This commit is contained in:
@@ -38,7 +38,6 @@ exception statement from your version. */
|
||||
|
||||
package java.net;
|
||||
|
||||
import gnu.classpath.NotImplementedException;
|
||||
import gnu.classpath.SystemProperties;
|
||||
|
||||
import java.io.IOException;
|
||||
@@ -173,6 +172,11 @@ public abstract class URLConnection
|
||||
|
||||
private static SimpleDateFormat[] dateFormats;
|
||||
private static boolean dateformats_initialized;
|
||||
|
||||
/**
|
||||
* The timeout period.
|
||||
*/
|
||||
private int timeout;
|
||||
|
||||
/* Cached ParsePosition, used when parsing dates. */
|
||||
private ParsePosition position;
|
||||
@@ -211,6 +215,38 @@ public abstract class URLConnection
|
||||
return url;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the connection timeout speed, in milliseconds, or zero if the timeout
|
||||
* is infinite or not set.
|
||||
*
|
||||
* @return The timeout.
|
||||
*
|
||||
* @since 1.5
|
||||
*/
|
||||
public int getConnectTimeout()
|
||||
{
|
||||
return timeout;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the connection timeout speed, in milliseconds, or zero if the timeout
|
||||
* is to be considered infinite. Note that in certain socket
|
||||
* implementations/platforms this method may not have any effect.
|
||||
*
|
||||
* Throws an <code>IllegalArgumentException</code> if timeout < 0.
|
||||
*
|
||||
* @param timeout - The timeout, in milliseconds.
|
||||
*
|
||||
* @since 1.5
|
||||
*/
|
||||
public void setConnectTimeout(int timeout)
|
||||
throws IllegalArgumentException
|
||||
{
|
||||
if( timeout < 0 )
|
||||
throw new IllegalArgumentException("Timeout must be 0 or positive.");
|
||||
this.timeout = timeout;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the value of the content-length header field or -1 if the value
|
||||
* is not known or not present.
|
||||
@@ -934,11 +970,12 @@ public abstract class URLConnection
|
||||
* @exception IOException If an error occurs
|
||||
*/
|
||||
public static String guessContentTypeFromStream(InputStream is)
|
||||
throws IOException, NotImplementedException
|
||||
throws IOException
|
||||
{
|
||||
// See /etc/gnome-vfs-mime-magic or /etc/mime-magic for a reasonable
|
||||
// idea of how to handle this.
|
||||
return "application/octet-stream";
|
||||
String result = VMURLConnection.guessContentTypeFromStream(is);
|
||||
if (result == null)
|
||||
return "application/octet-stream";
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user