Its my test task for job junior java can you help me how i must do that i cant understand what i must do upload file or what
As a Product Owner i would like to have Servlet WEB API that will allow me to query/filter
information from text files over web so that
- Any person would have access to file without uploading it on local box
- I can do basic query/filter operations online without using text editor or grep/awk/..
API should have following query params:
- limit: integer which represents max number of chars in text that API should return. If
parameter is blank or missing return max 10000 chars.
- q: string which represents text to search in file, i.e. if it q=java - API should return all
strings which equals to ‘java’ or containing it. If q is blank or missing - API should return
all text from file
Example of API call/response:
/somePath?q=Java&limit=1000&length=5&includeMetaData=true
Such call should return all strings that contains ‘Java’ with length <= 5 with total length <=
1000. Additionally metadata will be included.
Example JSON response:
{
"text":[
"Java",
"JavaC"
],
"metaData":{
"fileName":"javaLangSpec.txt",
"fileSize":"900KB",
"fileCreationDate":"January 23, 1996 at 12: 52PM"
}
As a Product Owner i would like to have Servlet WEB API that will allow me to query/filter
information from text files over web so that
- Any person would have access to file without uploading it on local box
- I can do basic query/filter operations online without using text editor or grep/awk/..
API should have following query params:
- limit: integer which represents max number of chars in text that API should return. If
parameter is blank or missing return max 10000 chars.
- q: string which represents text to search in file, i.e. if it q=java - API should return all
strings which equals to ‘java’ or containing it. If q is blank or missing - API should return
all text from file
Example of API call/response:
/somePath?q=Java&limit=1000&length=5&includeMetaData=true
Such call should return all strings that contains ‘Java’ with length <= 5 with total length <=
1000. Additionally metadata will be included.
Example JSON response:
{
"text":[
"Java",
"JavaC"
],
"metaData":{
"fileName":"javaLangSpec.txt",
"fileSize":"900KB",
"fileCreationDate":"January 23, 1996 at 12: 52PM"
}