|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.restlet.data.Reference
org.restlet.data.LocalReference
public final class LocalReference
Reference to a local (i.e. non remote) resource. It has helper methods for
the three following schemes: Protocol.CLAP
, Protocol.FILE
,
Protocol.JAR
and Protocol.RIAP
.
Field Summary | |
---|---|
static int |
CLAP_CLASS
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 Summary | |
---|---|
LocalReference(Reference localRef)
Constructor. |
|
LocalReference(java.lang.String localUri)
Constructor. |
Method Summary | |
---|---|
static LocalReference |
createClapReference(int authorityType,
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 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-dependant separator character. |
static java.lang.String |
normalizePath(java.lang.String path)
Normalize a path by converting all the system-dependant separator characters to the standard '/' separator character. |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public 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
Constructor Detail |
---|
public LocalReference(Reference localRef)
localRef
- The local reference.public LocalReference(java.lang.String localUri)
localUri
- The local URI.Method Detail |
---|
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.public static LocalReference createFileReference(java.lang.String filePath)
filePath
- The local file path.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 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()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |