Package io.milton.http.webdav
Class DefaultPropFindPropertyBuilder
java.lang.Object
io.milton.http.webdav.DefaultPropFindPropertyBuilder
- All Implemented Interfaces:
PropFindPropertyBuilder
This class performs the main part of PROPFIND processing, which is given a
field request (either named fields or an allprop request) and a target
resource, iterate over that resource and its children (depending on the depth
header) and list a list of PropFindResponse objects.
These PropFindResponse objects contain typed values for all of the known
fields, and a set of unknown fields. These will be used to build the xml
which is ultimately sent back to the client.
This class uses a list of PropertySource's, where each PropertySource
represents some mechanism to read properties from a resource.
- Author:
- brad
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuildProperties(PropFindableResource pfr, int depth, PropertiesRequest parseResult, String url) Construct a list of PropFindResponse for the given resource, using the PropertySource's injected into this class.findAllProps(PropFindableResource resource) static StringfixUrlForWindows(String url) Requested URL *should* never contain an ampersand because its a reserved character.getProperty(QName field, Resource resource) voidprocessResource(List<PropFindResponse> responses, PropFindableResource resource, PropertiesRequest parseResult, String href, int requestedDepth, int currentDepth, String collectionHref)
-
Constructor Details
-
DefaultPropFindPropertyBuilder
- Parameters:
propertySources- - the list of property sources used to read properties from resources
-
-
Method Details
-
buildProperties
public List<PropFindResponse> buildProperties(PropFindableResource pfr, int depth, PropertiesRequest parseResult, String url) throws URISyntaxException, NotAuthorizedException, BadRequestException Construct a list of PropFindResponse for the given resource, using the PropertySource's injected into this class.- Specified by:
buildPropertiesin interfacePropFindPropertyBuilder- Parameters:
pfr- - the resource to interrogatedepth- - the depth header. 0 means only look at the given resource. 1 is to include childrenparseResult- - contains the list of fields, or a true boolean indicating all propertiesurl- - the URL of the given resource - MUST be correctly encoded- Returns:
- Throws:
URISyntaxExceptionNotAuthorizedExceptionBadRequestException
-
getProperty
public ValueAndType getProperty(QName field, Resource resource) throws NotAuthorizedException, BadRequestException - Specified by:
getPropertyin interfacePropFindPropertyBuilder- Throws:
NotAuthorizedExceptionBadRequestException
-
processResource
public void processResource(List<PropFindResponse> responses, PropFindableResource resource, PropertiesRequest parseResult, String href, int requestedDepth, int currentDepth, String collectionHref) throws NotAuthorizedException, BadRequestException - Specified by:
processResourcein interfacePropFindPropertyBuilder- Throws:
NotAuthorizedExceptionBadRequestException
-
findAllProps
public Set<QName> findAllProps(PropFindableResource resource) throws NotAuthorizedException, BadRequestException - Specified by:
findAllPropsin interfacePropFindPropertyBuilder- Throws:
NotAuthorizedExceptionBadRequestException
-
fixUrlForWindows
Requested URL *should* never contain an ampersand because its a reserved character. However windows 7 does send unencoded ampersands in requests, but expects them to be encoded in responses.- Parameters:
url-- Returns:
-