|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.restlet.Uniform
org.restlet.Restlet
org.restlet.Finder
org.restlet.Directory
public class Directory
Finder mapping a directory of local resources. Those resources have representations accessed by the file system or the class loaders. An automatic content negotiation mechanism (similar to the one in Apache HTTP server) is used to select the best representation of a resource based on the available variants and on the client capabilities and preferences.
Constructor Summary | |
---|---|
Directory(Context context,
LocalReference rootLocalReference)
Constructor. |
|
Directory(Context context,
String rootUri)
Constructor. |
Method Summary | |
---|---|
Resource |
findTarget(Request request,
Response response)
Finds the target Resource if available. |
String |
getIndexName()
Returns the index name, without extensions. |
Representation |
getIndexRepresentation(Variant variant,
ReferenceList indexContent)
Returns an actual index representation for a given variant. |
List<Variant> |
getIndexVariants(ReferenceList indexContent)
Returns the variant representations of a directory index. |
Reference |
getRootRef()
Returns the root URI. |
boolean |
isDeeplyAccessible()
Indicates if the subdirectories are deeply accessible (true by default). |
boolean |
isListingAllowed()
Indicates if the display of directory listings is allowed when no index file is found. |
boolean |
isModifiable()
Indicates if modifications to context resources are allowed. |
boolean |
isNegotiateContent()
Indicates if the best content is automatically negotiated. |
void |
setDeeplyAccessible(boolean deeplyAccessible)
Indicates if the subdirectories are deeply accessible (true by default). |
void |
setIndexName(String indexName)
Sets the index name, without extensions. |
void |
setListingAllowed(boolean listingAllowed)
Indicates if the display of directory listings is allowed when no index file is found. |
void |
setModifiable(boolean modifiable)
Indicates if modifications to context resources are allowed. |
void |
setNegotiateContent(boolean negotiateContent)
Indicates if the best content is automatically negotiated. |
Methods inherited from class org.restlet.Finder |
---|
createResource, getTargetClass, handle |
Methods inherited from class org.restlet.Restlet |
---|
getContext, getLogger, init, isStarted, isStopped, setContext, start, stop |
Methods inherited from class org.restlet.Uniform |
---|
delete, delete, get, get, handle, head, head, options, options, post, post, put, put |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Directory(Context context, LocalReference rootLocalReference)
context
- The context.rootLocalReference
- The root Uri.public Directory(Context context, String rootUri)
context
- The context.rootUri
- The absolute root URI. Method Detail |
---|
public Resource findTarget(Request request, Response response)
findTarget
in class Finder
request
- The request to filter.response
- The response to filter.
public String getIndexName()
public Representation getIndexRepresentation(Variant variant, ReferenceList indexContent)
variant
- The selected variant.indexContent
- The directory index to represent.
public List<Variant> getIndexVariants(ReferenceList indexContent)
indexContent
- The list of references contained in the directory index.
public Reference getRootRef()
public boolean isDeeplyAccessible()
public boolean isListingAllowed()
public boolean isModifiable()
public boolean isNegotiateContent()
public void setDeeplyAccessible(boolean deeplyAccessible)
deeplyAccessible
- True if the subdirectories are deeply accessible.public void setIndexName(String indexName)
indexName
- The index name.public void setListingAllowed(boolean listingAllowed)
listingAllowed
- True if the display of directory listings is allowed when no
index file is found.public void setModifiable(boolean modifiable)
modifiable
- True if modifications to context resources are allowed.public void setNegotiateContent(boolean negotiateContent)
negotiateContent
- True if the best content is automatically negotiated.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |