Package org.restlet.engine.local
Class FileClientHelper
Connector to the file resources accessible. Here is the list of parameters
that are supported. They should be set in the Client's context before it is
started:
| Parameter name | Value type | Default value | Description |
|---|---|---|---|
| temporaryExtension | String | tmp | The name of the extension to use to store the temporary content while uploading content via the PUT method. |
| resumeUpload | boolean | false | Indicates if a failed upload can be resumed. This will prevent the deletion of the temporary file created. |
- Author:
- Jerome Louvel, Thierry Boileau
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanCheck that all extensions of the file correspond to a known metadata.Returns a local entity for the given path.Returns the name of the extension to use to store the temporary content while uploading content via the PUT method.protected voidhandleFile(Request request, Response response, String decodedPath) protected voidhandleFileDelete(Response response, File file) Handles a DELETE call for the FILE protocol.protected voidhandleFilePut(Request request, Response response, String path, File file) Handles a PUT call for the FILE protocol.protected voidhandleLocal(Request request, Response response, String decodedPath) Handles a local call.booleanIndicates if a failed upload can be resumed.Methods inherited from class org.restlet.engine.local.EntityClientHelper
createReference, getReencodedVariantEntityName, handleEntityGetMethods inherited from class org.restlet.engine.local.LocalClientHelper
getDefaultLanguage, getTimeToLive, handleMethods inherited from class org.restlet.engine.connector.ConnectorHelper
getConnectorService, getContext, getProtocols, start, stop, updateMethods inherited from class org.restlet.engine.RestletHelper
getAttributes, getHelped, getHelpedParameters, getLogger, getMetadataService, setHelped
-
Constructor Details
-
FileClientHelper
Constructor.- Parameters:
client- The client to help.
-
-
Method Details
-
checkExtensionsConsistency
Check that all extensions of the file correspond to a known metadata.- Parameters:
file- The file whose extensions are checked.- Returns:
- True if all extensions of the file are known by the metadata service.
-
getEntity
Description copied from class:EntityClientHelperReturns a local entity for the given path.- Specified by:
getEntityin classEntityClientHelper- Parameters:
decodedPath- The path of the entity.- Returns:
- A local entity for the given path.
-
getTemporaryExtension
Returns the name of the extension to use to store the temporary content while uploading content via the PUT method. Defaults to "tmp".- Returns:
- The name of the extension to use to store the temporary content.
-
handleLocal
Description copied from class:LocalClientHelperHandles a local call.- Overrides:
handleLocalin classEntityClientHelper- Parameters:
request- The request to handle.response- The response to update.decodedPath- The decoded local path.
-
handleFile
-
handleFileDelete
Handles a DELETE call for the FILE protocol.- Parameters:
response- The response to update.file- The file or directory to delete.
-
handleFilePut
Handles a PUT call for the FILE protocol.- Parameters:
request- The request to update.response- The response to update.path- The encoded path of the requested file or directory.file- The requested file or directory.
-
isResumeUpload
public boolean isResumeUpload()Indicates if a failed upload can be resumed. This will prevent the deletion of the temporary file created. Defaults to "false".- Returns:
- True if a failed upload can be resumed, false otherwise.
-