I have a system with various servers in "servers.txt" and each server store  files inside "files" folder using as filename the hash sha256 of file plus original extension. For each file also exist the same filename inside "info" folder but using as filename the hash of file plus ".json" extension and this file store metadata informations. All files of "files" directory are in the file "files.txt" with one filename per line and "files.txt" is stored in root directory. So create a gui program in Java, all in the same file, compatible with java 8 and without external libraries, that will read the contents in "servers.txt" and check the file "files.txt" in each servers, so will get the JSON contents of each file inside "info" folder of server and show as result the entries that match with user input allowing user download the file when click in the result. You can show the results as you find them so as not to make the user wait too long or get stuck. each JSON field cannot exceeds 512 in lenght and if exceeds truncate the field. Show the maximum of 200 results. There is a button where the user can download the files of all servers including the files in "files" and "info". Other for download all files only that match with his input (including the files in "files" with same name of files in "info" but using the extesion of field "extension"). Also there is a option by default not checked when the user can insert a number of random tries that will do in the JSON files in each server instead of list all JSON files of each server(Per example, "http://test.com" have the file "http://test.com/files.txt" and inside "files.txt" will be a filename with extension that as "cat.jpg" that is stored inside the folder "files").  The program name is "Meshare". for each successful download you can save inside "log" folder a JSON file with name of file downloaded and put the date of download.  I will send example files for you view the structure used.

all binary files (files listed in "files.txt" in each server) will be saved directly in the "files" folder and the json files in the "info" folder not inside a folder with the server name. you will download the binary file only if the filename match with hash and if not will not download the binary either the json file. in the file "files.txt" the filename per line must follow the specif format of filename.ext (where filename must be a valid hash sha256) and if the line do not follow this format will be skipp. when you do search in the servers in the file "files.txt" you skipp to request and download all files that you already downloaded (per example, if you already have the file 123.jpg and in the file "files.txt" of one server there is a line with "123.jpg" you will skill both the request of json file for show in the results and also will skipp the download of filehash check. you can skipp the request but shows in the result that already be downloaded and show the information form the json file downloaded

I want that you rewrite the search logic of this program. Now for every JSON file found in the servers you will download it automatically in "info" folder and if already exists will not dowload again. When user do a search in the servers if any file from "files.txt" in the servers already exists in the local "info" folder (per example for the file "hash.jpg" the local file checked will be "hash.json" in "info" folder) so you will load the file information from local folder instead of do a request to load JSON file in the external server for get file information. Add a option called "Allow links" that by default is checked and the user can uncheck. If this option is active so the search also will try get the file "links.txt" in each server and show in the results the lines that match with user input and each line has the limit 5.000 lenght. If the line of "links.txt" be a valid URL with a valid file extension you will try download it inside folder "files" using as filename the hash of file and the original extension. also will create a json file inside "info" folder using as filename the filename plus "json" extension and inside the JSON file in the field "server_public_key" put the content os file "public_key.txt" (if any but can be empty) and in field "description" will put the full url.  If the line in "links.txt" is invalid URL or any other type of content so you will not try download the contents as  a URL but will try download the raw line contents in the folder "files" using as filename the hash of line contents plus ".txt" extension and also will create a json file inside "info" folder using as filename the filename plus "json" extension and inside the JSON file in the field "server_public_key" put the content os file "public_key.txt" and in field "description" will put the full line contents. Load the contents of local JSON file and downlaod automatically any JSON file work both for traditional search and for "links" search option. Do compatible with java 8, all in the same file and without external dependencies.

lets check the "links.txt" and links download option. if you find a link you will not try download it automatically (even being valid).

