Retrieving data from web browser's download manager using java - java

I want to try creating a program that can automate the storing of web address that is available on every downloaded file on a web browser.
My problem is I don't know where to start.
What am I planning to do is just save all the downloaded file's web addresses in a excel file.
Sample image using google chrome

I think Firefox stores the download history in the places.sqlite file in your Profile folder. You would need to open and read that file, but you probably can't while Firefox is open (it has the file open).
http://kb.mozillazine.org/Places.sqlite
From there, you can process the data in your Java app and then write an Excel file, perhaps using Apache POI (the Java API for Microsoft Documents)
https://poi.apache.org/

Where and how, download history is stored varies from browser to browser . In case of Chrome on Mac it is store in the path
~/Library/Application\ Support/Google/Chrome/Default/DownloadMetadata
as SQLite format.
You need to write an application to parse the data and create xls

Related

Unable to configure JSON in android studio

I'm working on a project. There is a website coded in asp.net and database is SQL. and there is a mobile app connect to this site.in app it used JSON and no db codes. I added new tables to this site and I want to configure it from android studio. I'm new to JSON so I can't config the database from android studio. And I want to know what is a .ashx file is? I can't add code snips due to privacy policy in company. Thank you very much!
.ashx file details:
A file with the ASHX file extension is an ASP.NET Web Handler file that often holds references to other web pages used in an ASP.NET web server application.
The functions in the ASHX file are written in the C# programming language, and sometimes the references are so short that an ASHX file may end up just being a single line of code.
Most people only encounter ASHX files by accident when they try to download a file from a website, like a PDF file. This is because the ASHX file references the PDF file to send it to the browser for download but doesn't name it correctly, attaching .ASHX at the end instead of .PDF.
source: https://www.lifewire.com/ashx-file-2619693
And as far as I think for accessing JSON in the android studio you can look into volley.
Volley Documentation: https://developer.android.com/training/volley

How to download file from a "Download" folder using postman or API

In my application, after clicking export icon, the report excel has been downloaded/generated in our local download folder in the system. I have tried to validate this action using service side (API)-postman. When I hit the export api (Application specific) , the response has not contain any path/file name that downloaded in the downloads folder. Is there any way that we can hit the downloads folder using api or any java programming way to get the downloaded excel.
I just want to read the excel data and compare with my input data using postman. First priority that I need to do it using api.
Select "Send and download" action in Postman. According to manual here:
If your API endpoint returns an image, Postman will detect and render
it automatically. For binary response types, you should select “Send
and download” which will let you save the response to your hard disk.
You can then view it using the appropriate viewer. This gives you the
flexibility to test audio files, PDFs, zip files, or anything that the
API throws at you.

Download PDF file for offline viewing

I'm trying to cache PDF files on the user's device and open them within my app at a later time.
With this package: https://github.com/barteksc/AndroidPdfViewer
I use pdfView.fromUri(uri) which loads the file from the URL every time the page is loaded.
Is there a function I can use to cache these files for offline viewing?
Download the PDF yourself, using your favorite HTTP client API. Then, use fromFile() rather than fromUri().

Android + SQL Server + jTDS

I'm trying to build an android app with connection to our SQL Server. I have downloaded the jTDS JDBC Driver. I have an jar file and have to copy it to my application's classpath. But where is that? I have copied to my workspace in the project directory where the file ".classpath" is. But it seems not to work.... everytime if I'm at the code where I load the class with
Class.forName("net.sourceforge.jtds.jdbc.Driver");
it says:
The source attachment does not contain the source for the file ClassLoader.class. You can change the source attachment by clicking Change Attachmend Source below"
Any ideas? I'm new to java AND android...
no need of that much of mess.
Simply for Mysql Server Data Access or any live server data access.
Make Use of Web Services
Its like prepare a dynamic page that have all the fetched data result from the server. Your android application need to hit that dyanamic page URL and then simply read the content from the streams and use them in your application.
Genrally large amount of data is expressed in xml format which is then parsed from the application See on google about SAXParser
In short its like a web page that will echo your server data after your app hit the url of that web page to read the data.

Zip File on a web server to extract in to local machine

We have a web application that allows user to download a zip file from a web server. We just provide dummy iframe source to the full URL of zip file on web server. This approach would allow end user to use browser controls which allows the user to open or save the zip to user's local machine.
We have a requirement that the zip file is automatically extracted and save to a specific location on user's machine. Any thoughts on how this can be achieved?
Thanks.
I highly doubt that you'll be able to do that. The closest you're likely to get is to generate a self-extracting executable file (which would be OS-dependent, of course).
I certainly wouldn't want a zip file to be automatically extracted - and I wouldn't want my browser to be able to force that decision upon me.
Short answer is I don't believe this is possible using the simple URL link you've implemented.
Fundamentally the problem you have is that you have no control over what the user does on their end, since you've ceded control to the browser.
If you do want to do this, then you'll need some client-side code that downloads the zipfile and unzips it.
I suspect Java is the way to go for this - Javascript and Flash both have problems writing files to the local drive. Of course if you want to be Windows only then a COM object could work.
Instead of sending a zip file why don't u instruct the web server to compress all the web traffic and just send the files directly?
See http://articles.sitepoint.com/article/web-output-mod_gzip-apache# for example.

Categories