|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.mucommander.file.DefaultSchemeHandler
public class DefaultSchemeHandler
This class provides a default SchemeHandler implementation. The no-arg constructor creates an
instance with default values that suit most schemes. This is how the default URL handler returned by
FileURL.getDefaultHandler() is created.
The multi-arg constructor allows to create a scheme handler with specific values.
The getRealm(FileURL) implementation returns a URL with the same scheme and host (if any) as the specified
URL, and a path set to "/". This behavior can be modified by overridding getRealm.
FileURL.getDefaultHandler(),
SchemeHandler| Field Summary | |
|---|---|
protected int |
authenticationType
|
protected Credentials |
guestCredentials
|
protected SchemeParser |
parser
|
protected java.lang.String |
pathSeparator
|
protected int |
standardPort
|
| Constructor Summary | |
|---|---|
DefaultSchemeHandler()
Creates a DefaultSchemeHandler with default values that suit most schemes: the parser is a DefaultSchemeParser instance created with the no-arg constructor the scheme's standard port is -1
the scheme's path separator is "/"
authentication type is AuthenticationTypes.NO_AUTHENTICATION
guest credentials are null
|
|
DefaultSchemeHandler(SchemeParser parser,
int standardPort,
java.lang.String pathSeparator,
int authenticationType,
Credentials guestCredentials)
Creates a DefaultSchemeHandler with the specified values. |
|
| Method Summary | |
|---|---|
int |
getAuthenticationType()
Returns the authentication type that was passed to the constructor. |
Credentials |
getGuestCredentials()
Returns the set of guest credentials that was passed to the constructor. |
SchemeParser |
getParser()
Returns the parser that was passed to the constructor. |
java.lang.String |
getPathSeparator()
Returns the path separator that was passed to the constructor. |
FileURL |
getRealm(FileURL location)
Returns a URL with the same scheme, host and port (if any) as the specified URL, and a path set to "/". |
int |
getStandardPort()
Returns the standard port that was passed to the constructor. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected SchemeParser parser
protected int standardPort
protected java.lang.String pathSeparator
protected int authenticationType
protected Credentials guestCredentials
| Constructor Detail |
|---|
public DefaultSchemeHandler()
-1"/"AuthenticationTypes.NO_AUTHENTICATIONnull
public DefaultSchemeHandler(SchemeParser parser,
int standardPort,
java.lang.String pathSeparator,
int authenticationType,
Credentials guestCredentials)
parser - the parser that takes care of parsing URL strings and turning them into FileURLstandardPort - the scheme's standard port, -1 for nonepathSeparator - the scheme's path separator, cannot be nullauthenticationType - the type of authentication used by the scheme's file protocolguestCredentials - the scheme's guest credentials, null for none| Method Detail |
|---|
public SchemeParser getParser()
getParser in interface SchemeHandlerpublic int getAuthenticationType()
getAuthenticationType in interface SchemeHandlerpublic Credentials getGuestCredentials()
getGuestCredentials in interface SchemeHandlerpublic java.lang.String getPathSeparator()
getPathSeparator in interface SchemeHandlerpublic int getStandardPort()
getStandardPort in interface SchemeHandlerpublic FileURL getRealm(FileURL location)
"/".
The login, password, query and fragment parts of the returned URL are always null.
For example, when called with http://www.mucommander.com:8080/path/to/file?query¶m=value,
this method returns http://www.mucommander.com:8080/.
getRealm in interface SchemeHandlerlocation - the location for which to return the authentication realm
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
This file is part of muCommander - Copyright (C) 2002-2008 Maxence Bernard