|
||||||||||
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 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_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 Summary | |
---|---|
LocalReference(Reference localRef)
Constructor. |
|
LocalReference(String localUri)
Constructor. |
Method Summary | |
---|---|
static LocalReference |
createClapReference(int authorityType,
Package pkg)
Constructor for CLAP URIs to a given package. |
static LocalReference |
createClapReference(int authorityType,
String path)
Constructor. |
static LocalReference |
createClapReference(Package pkg)
Constructor. |
static LocalReference |
createClapReference(String path)
Constructor. |
static LocalReference |
createFileReference(File file)
Constructor. |
static LocalReference |
createFileReference(String filePath)
Constructor. |
static LocalReference |
createFileReference(String hostName,
String filePath)
Constructor. |
static LocalReference |
createJarReference(Reference jarFile,
String entryPath)
Constructor. |
static LocalReference |
createRiapReference(int authorityType,
String path)
Constructor. |
static LocalReference |
createZipReference(Reference zipFile,
String entryPath)
Constructor. |
static String |
getAuthorityName(int authority)
Returns an authority name. |
int |
getClapAuthorityType()
Returns the type of authority. |
File |
getFile()
Gets the local file corresponding to the reference. |
String |
getJarEntryPath()
Returns the JAR entry path. |
Reference |
getJarFileRef()
Returns the JAR file reference. |
int |
getRiapAuthorityType()
Returns the type of authority. |
static String |
localizePath(String path)
Localize a path by converting all the separator characters to the system-dependent separator character. |
static String |
normalizePath(String path)
Normalize a path by converting all the system-dependent 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_DEFAULT
CLAP_CLASS
authority.
Examples: clap:///rootPkg/subPkg/myClass.class or
clap:///rootPkg/file.html
Class.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
Constructor Detail |
---|
public LocalReference(Reference localRef)
localRef
- The local reference.public LocalReference(String localUri)
localUri
- The local URI.Method Detail |
---|
public static LocalReference createClapReference(Package pkg)
pkg
- The package to identify.public static LocalReference createClapReference(int authorityType, Package pkg)
authorityType
- The authority type for the resource path.pkg
- The package to identify.public static LocalReference createClapReference(String path)
path
- The resource path.public static LocalReference createClapReference(int authorityType, String path)
authorityType
- The authority type for the resource path.path
- The resource path.public static LocalReference createFileReference(File file)
file
- The file whose path must be used.
createFileReference(String)
public static LocalReference createFileReference(String filePath)
filePath
- The local file path.createFileReference(String, String)
public static LocalReference createFileReference(String hostName, 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, String entryPath)
jarFile
- The JAR file reference.entryPath
- The entry path inside the JAR file.public static LocalReference createRiapReference(int authorityType, String path)
authorityType
- The authority type for the resource path.path
- The resource path.public static LocalReference createZipReference(Reference zipFile, String entryPath)
zipFile
- The Zip file reference.entryPath
- The entry path inside the Zip file.public static String getAuthorityName(int authority)
authority
- The authority.
public static String localizePath(String path)
path
- The path to localize.
public static String normalizePath(String path)
path
- The path to normalize.
public int getClapAuthorityType()
public File getFile()
public String getJarEntryPath()
public Reference getJarFileRef()
public int getRiapAuthorityType()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |