public final class LocalReference extends Reference
Protocol.CLAP
, Protocol.FILE
, Protocol.JAR
and Protocol.RIAP
.Modifier and Type | Field and Description |
---|---|
static int |
CLAP_CLASS
The resources will be resolved from the classloader associated with the
local class.
|
static int |
CLAP_DEFAULT
The resources will be resolved from the classloader associated with the
local class.
|
static int |
CLAP_SYSTEM
The resources will be resolved from the system's classloader.
|
static int |
CLAP_THREAD
The resources will be resolved from the current thread's classloader.
|
static int |
RIAP_APPLICATION
The resources will be resolved from the current application's root
Restlet.
|
static int |
RIAP_COMPONENT
The resources will be resolved from the current component's internal
(private) router.
|
static int |
RIAP_HOST
The resources will be resolved from the current component's virtual host.
|
Constructor and Description |
---|
LocalReference(Reference localRef)
Constructor.
|
LocalReference(java.lang.String localUri)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
static LocalReference |
createClapReference(int authorityType,
java.lang.Package pkg)
Constructor for CLAP URIs to a given package.
|
static LocalReference |
createClapReference(int authorityType,
java.lang.String path)
Constructor.
|
static LocalReference |
createClapReference(java.lang.Package pkg)
Constructor.
|
static LocalReference |
createClapReference(java.lang.String path)
Constructor.
|
static LocalReference |
createFileReference(java.io.File file)
Constructor.
|
static LocalReference |
createFileReference(java.lang.String filePath)
Constructor.
|
static LocalReference |
createFileReference(java.lang.String hostName,
java.lang.String filePath)
Constructor.
|
static LocalReference |
createJarReference(Reference jarFile,
java.lang.String entryPath)
Constructor.
|
static LocalReference |
createRiapReference(int authorityType,
java.lang.String path)
Constructor.
|
static LocalReference |
createZipReference(Reference zipFile,
java.lang.String entryPath)
Constructor.
|
static java.lang.String |
getAuthorityName(int authority)
Returns an authority name.
|
int |
getClapAuthorityType()
Returns the type of authority.
|
java.io.File |
getFile()
Gets the local file corresponding to the reference.
|
java.lang.String |
getJarEntryPath()
Returns the JAR entry path.
|
Reference |
getJarFileRef()
Returns the JAR file reference.
|
int |
getRiapAuthorityType()
Returns the type of authority.
|
static java.lang.String |
localizePath(java.lang.String path)
Localize a path by converting all the separator characters to the
system-dependent separator character.
|
static java.lang.String |
normalizePath(java.lang.String path)
Normalize a path by converting all the system-dependent separator
characters to the standard '/' separator character.
|
addQueryParameter, addQueryParameter, addQueryParameters, addSegment, clone, decode, decode, encode, encode, encode, encode, equals, getAuthority, getAuthority, getBaseRef, getExtensions, getExtensionsAsArray, getFragment, getFragment, getHierarchicalPart, getHierarchicalPart, getHostDomain, getHostDomain, getHostIdentifier, getHostIdentifier, getHostPort, getIdentifier, getIdentifier, getLastSegment, getLastSegment, getLastSegment, getMatrix, getMatrix, getMatrixAsForm, getMatrixAsForm, getParentRef, getPath, getPath, getQuery, getQuery, getQueryAsForm, getQueryAsForm, getQueryAsForm, getRelativePart, getRelativePart, getRelativeRef, getRelativeRef, getRemainingPart, getRemainingPart, getRemainingPart, getScheme, getScheme, getSchemeProtocol, getSchemeSpecificPart, getSchemeSpecificPart, getSegments, getSegments, getTargetRef, getUserInfo, getUserInfo, hasExtensions, hasFragment, hashCode, hasMatrix, hasQuery, hasScheme, isAbsolute, isEquivalentTo, isGenericDelimiter, isHierarchical, isOpaque, isParent, isRelative, isReserved, isSubDelimiter, isUnreserved, isValid, normalize, setAuthority, setBaseRef, setBaseRef, setExtensions, setExtensions, setFragment, setHostDomain, setHostPort, setIdentifier, setLastSegment, setPath, setProtocol, setQuery, setRelativePart, setScheme, setSchemeSpecificPart, setSegments, setUserInfo, toString, toString, toString, toString, toString, toUri, toUrl
public static final int CLAP_DEFAULT
CLAP_CLASS
authority.
Examples: clap:///rootPkg/subPkg/myClass.class or
clap:///rootPkg/file.htmlClass.getClassLoader()
,
Constant Field Valuespublic static final int CLAP_CLASS
Class.getClassLoader()
,
Constant Field Valuespublic static final int CLAP_SYSTEM
ClassLoader.getSystemClassLoader()
,
Constant Field Valuespublic static final int CLAP_THREAD
Thread.getContextClassLoader()
,
Constant Field Valuespublic static final int RIAP_APPLICATION
public static final int RIAP_COMPONENT
public static final int RIAP_HOST
public LocalReference(Reference localRef)
localRef
- The local reference.public LocalReference(java.lang.String localUri)
localUri
- The local URI.public static LocalReference createClapReference(java.lang.Package pkg)
pkg
- The package to identify.public static LocalReference createClapReference(int authorityType, java.lang.Package pkg)
authorityType
- The authority type for the resource path.pkg
- The package to identify.public static LocalReference createClapReference(java.lang.String path)
path
- The resource path.public static LocalReference createClapReference(int authorityType, java.lang.String path)
authorityType
- The authority type for the resource path.path
- The resource path.public static LocalReference createFileReference(java.io.File file)
file
- The file whose path must be used.createFileReference(String)
public static LocalReference createFileReference(java.lang.String filePath)
filePath
- The local file path.createFileReference(String, String)
public static LocalReference createFileReference(java.lang.String hostName, java.lang.String filePath)
hostName
- The authority (can be a host name or the special "localhost"
or an empty value).filePath
- The file path.public static LocalReference createJarReference(Reference jarFile, java.lang.String entryPath)
jarFile
- The JAR file reference.entryPath
- The entry path inside the JAR file.public static LocalReference createRiapReference(int authorityType, java.lang.String path)
authorityType
- The authority type for the resource path.path
- The resource path.public static LocalReference createZipReference(Reference zipFile, java.lang.String entryPath)
zipFile
- The Zip file reference.entryPath
- The entry path inside the Zip file.public static java.lang.String getAuthorityName(int authority)
authority
- The authority.public static java.lang.String localizePath(java.lang.String path)
path
- The path to localize.public static java.lang.String normalizePath(java.lang.String path)
path
- The path to normalize.public int getClapAuthorityType()
public java.io.File getFile()
public java.lang.String getJarEntryPath()
public Reference getJarFileRef()
public int getRiapAuthorityType()
Copyright © 2005-2024 Restlet.