站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > NetBeans API Javadoc 4.1.0

HttpServer (NetBeans APIs) - NetBeans API Javadoc 4.1.0


org.openide.util
Class HttpServer

java.lang.Object
  extended byorg.openide.util.HttpServer

Deprecated. The httpserver module should provide a replacement for this API if necessary.

public abstract class HttpServer
extends Object

Maps internal NetBeans resources such as repository objects to URLs. The mapping is delegated to an HTTP server module, which registers to do the mapping. It is also responsible for actually serving the individual data objects from the Repository and resources from the system classpath.


Nested Class Summary
static interface HttpServer.Impl
          Deprecated. Useful only for HttpServer which is itself deprecated.
 
Method Summary
static boolean allowAccess(InetAddress addr)
          Deprecated. Should be replaced by an API in the httpserver module if still required.
static void deregisterServer(HttpServer.Impl server)
          Deprecated. As of 2.11 use Lookup instead of registering and derigistering HTTP server
static URL getRepositoryRoot()
          Deprecated. Assumes repository equals classpath.
static URL getRepositoryURL(FileObject fo)
          Deprecated. Use URLMapper instead.
static URL getResourceRoot()
          Deprecated. Use URLMapper with a URL protocol nbres.
static URL getResourceURL(String resourcePath)
          Deprecated. Use URLMapper with a URL protocol nbres.
static void registerServer(HttpServer.Impl server)
          Deprecated. As of 2.11 use Lookup instead of registering HTTP server
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

registerServer

public static void registerServer(HttpServer.Impl server)
                           throws SecurityException
Deprecated. As of 2.11 use Lookup instead of registering HTTP server

Register the system HTTP server. Typically this would be done in ModuleInstall.installed() or ModuleInstall.restored().

Parameters:
server - the server to register
Throws:
SecurityException - if there was already one registered

deregisterServer

public static void deregisterServer(HttpServer.Impl server)
                             throws SecurityException
Deprecated. As of 2.11 use Lookup instead of registering and derigistering HTTP server

Deregister the system HTTP server. Typically this would be done in ModuleInstall.uninstalled().

Parameters:
server - the server to deregister
Throws:
SecurityException - if the specified server was not the installed one

getRepositoryURL

public static URL getRepositoryURL(FileObject fo)
                            throws MalformedURLException,
                                   UnknownHostException
Deprecated. Use URLMapper instead.

Map a file object to a URL. Should ensure that the file object is accessible via the given URL.

Parameters:
fo - the file object to represent
Returns:
a URL providing access to it
Throws:
MalformedURLException - for the usual reasons
UnknownHostException - for the usual reasons, or if there is no registered server

getRepositoryRoot

public static URL getRepositoryRoot()
                             throws MalformedURLException,
                                    UnknownHostException
Deprecated. Assumes repository equals classpath.

Map the repository root to a URL. This URL should serve a page from which repository objects are accessible. This means that it should serve a package-oriented view of the Repository, corresponding to a merge of all files present in the root folders of visible file systems.

Returns:
a URL
Throws:
MalformedURLException - for the usual reasons
UnknownHostException - for the usual reasons, or if there is no registered server

getResourceURL

public static URL getResourceURL(String resourcePath)
                          throws MalformedURLException,
                                 UnknownHostException
Deprecated. Use URLMapper with a URL protocol nbres.

Map a resource path to a URL. Should ensure that the resource is accessible via the given URL.

Parameters:
resourcePath - path of the resource in classloader format (e.g. /some/path/resources/icon32.gif)
Returns:
a URL providing access to it
Throws:
MalformedURLException - for the usual reasons
UnknownHostException - for the usual reasons, or if there is no registered server
See Also:
ClassLoader.getResource(java.lang.String)

getResourceRoot

public static URL getResourceRoot()
                           throws MalformedURLException,
                                  UnknownHostException
Deprecated. Use URLMapper with a URL protocol nbres.

Get URL root for a resource from system classpath.

Returns:
the URL
Throws:
MalformedURLException - for the usual reasons
UnknownHostException - for the usual reasons
See Also:
getResourceURL(java.lang.String)

allowAccess

public static boolean allowAccess(InetAddress addr)
                           throws UnknownHostException
Deprecated. Should be replaced by an API in the httpserver module if still required.

Requests the server to allow access to it from a given IP address. This can be useful if a module wishes another machine to be able to access the server, such as a machine running a deployment server. The server may or may not grant access to the IP address, for example if the user does not wish to grant access to the IP address.

Parameters:
addr - address for which access is requested
Returns:
true if access has been granted
Throws:
UnknownHostException


Built on May 4 2005.  |  Portions Copyright 1997-2005 Sun Microsystems, Inc. All rights reserved.