Top Description Fields Constructors Methods
bsh.util

public Class Httpd

Additional top-level class in compilation unit: HttpdConnection.

extends Thread
Class Inheritance
Imports
java.io.*, java.util.StringTokenizer, java.net.Socket, .ServerSocket

A very simple httpd that supports the remote server mode. Files are loaded relative to the classpath (as resources).

Warning

this is not secure! This server can probably be duped into serving any file on your system! Beware! Note: at some point this should be recast as a beanshell script.

Field Summary

Modifier and TypeField and Description
pack-priv ServerSocket
Inherited from java.lang.Thread:
MAX_PRIORITYMIN_PRIORITYNORM_PRIORITY

Constructor Summary

AccessConstructor and Description
public
Httpd(int port)

Method Summary

Modifier and TypeMethod and Description
public static void
main(String[] argv)

public void
run()

Overrides java.lang.Thread.run.

Implements java.lang.Runnable.run.

This method is run by the thread when it executes.
Inherited from java.lang.Thread:
activeCountcheckAccessclonecountStackFramescurrentThreaddumpStackenumerategetAllStackTracesgetContextClassLoadergetDefaultUncaughtExceptionHandlergetIdgetNamegetPrioritygetStackTracegetStategetThreadGroupgetUncaughtExceptionHandlerholdsLockinterruptinterruptedisAliveisDaemonisInterruptedisVirtualjoinjoinjoinjoinofPlatformofVirtualonSpinWaitresumesetContextClassLoadersetDaemonsetDefaultUncaughtExceptionHandlersetNamesetPrioritysetUncaughtExceptionHandlersleepsleepsleepstartstartVirtualThreadstopsuspendthreadIdtoStringyield

Field Detail

ssback to summary
pack-priv ServerSocket ss

Constructor Detail

Httpdback to summary
public Httpd(int port) throws IOException

Method Detail

mainback to summary
public static void main(String[] argv) throws IOException
runback to summary
public void run()

Overrides java.lang.Thread.run.

Implements java.lang.Runnable.run.

Doc from java.lang.Thread.run.

This method is run by the thread when it executes. Subclasses of Thread may override this method.

This method is not intended to be invoked directly. If this thread is a platform thread created with a Runnable task then invoking this method will invoke the task's run method. If this thread is a virtual thread then invoking this method directly does nothing.