Package org.hcjf.io.net.http
Class FolderContext
- java.lang.Object
-
- org.hcjf.io.net.http.Context
-
- org.hcjf.io.net.http.FolderContext
-
public class FolderContext extends Context
This class publish some local folder in the web environment.- Author:
- javaito
-
-
Field Summary
-
Fields inherited from class org.hcjf.io.net.http.Context
END_CONTEXT, START_CONTEXT, URI_FOLDER_SEPARATOR
-
-
Constructor Summary
Constructors Constructor Description FolderContext(java.lang.String name, java.nio.file.Path baseFolder)FolderContext(java.lang.String name, java.nio.file.Path baseFolder, java.lang.String defaultFile)
-
Method Summary
Modifier and Type Method Description HttpResponseonContext(HttpRequest request)This method is called when there comes a http package addressed to this context.booleanonNonExistentFile(HttpRequest request, java.io.File file)This method could be implemented in order to manage the non-existent file situation.-
Methods inherited from class org.hcjf.io.net.http.Context
addDefaultResponseHeaders, createDefaultErrorResponse, getContextRegex, getPattern, getTimeout, onError, setTimeout
-
-
-
-
Method Detail
-
onContext
public final HttpResponse onContext(HttpRequest request)
This method is called when there comes a http package addressed to this context.
-
onNonExistentFile
public boolean onNonExistentFile(HttpRequest request, java.io.File file)
This method could be implemented in order to manage the non-existent file situation. By default this implementation throws an IllegalArgument exception if the file not exists.- Parameters:
request- Http request instance.file- non-existent file pointer.- Returns:
- Return true if the read file operation must by retried and false in the otherwise.
-
-