access remote url from eclipse plugin - eclipse

I know it's possible to load a webpage inside eclipse, but this isn't what I'm looking for. What I'm looking for is to load raw data (json or xml) from a remote url via http. For example the plugin could request data for bugs with status unresolved. That query will go to the url which will return data. My plugin needs to then read this data. So any suggestions what I need to get this done?

new URL(url).openStream() will open an input stream. you an read data from this stream.

You may want to have a look at REST(Representational state transfer).

Related

How to handle dynamic list (JSON) of redirects on NextJS + AWS Amplify?

I have a JSON file with 8k+ redirects that I use for my site. This JSON is hosted on a CDN (AWS Cloudfront). And every time one of our products or pages change their path, that JSON is automatically updated with a new redirect, and this happens pretty often (more than once a day).
I want to be able to use that JSON on my NextJS (12.3) project hosted on AWS Amplify.
Ideally I wanted to use the NextJS middleware.js to fetch that JSON and redirect to the proper path.
But right now Amplify doesn't support that middleware. They still have an open issue on github for that:
https://github.com/aws-amplify/amplify-js/issues/9145
So I tried to run that on getServerSideProps. But I'd have to replicate that for every URL segment on my project, which wouldn't look great.
Right now I use the native redirects solution on the next.config.js file (https://nextjs.org/docs/api-reference/next.config.js/redirects).
But this solution isn't great either for two reasons:
This is not dynamic. The JSON file is only fetched when the project is build up, so many times I have to redeploy my project on Amplify to be able to update those redirects.
The latency to find the correct path is affecting the page load perfomance (it takes around 400 to 500ms to run through the 8k+ redirects).
Can anyone help me to find a fast and dynamic solution to fetch and do those redirects on NextJS? Or maybe any idea to do that in a different way.

How to load csv from url and display as listview flutter

I am new to flutter and I found load csv from local and display as listview but I want to load from url and display. How can I do that?
A .csv from a remote source will probably have the content type of text/csv.
You should be able to call the url using a library (https://pub.dev/packages/http is a good choice, although I hear good things about Dio and probably a few others I haven't come across), get the data (e.g. as a http.Response), parse the response into some sort of model and then display it within the list view. Ideally the differences between displaying data from a local and remote source would be minimal - just where the data is coming from. This means you should be able to reuse the code you've written to load the data from a local source.
Without more information its hard to help. There's a good tutorial on building out Flutter apps using the Clean architecture at https://resocoder.com/category/tutorials/flutter/tdd-clean-architecture/. The difference will be that the Response data will be csv rather than JSON, so you'll need to sub in what you've done for the local loading.

SLIM API - Offer Files to Download

I am using Slim API for my Project. I want to offer Files for Download (Mostly PDF files). I found several Ways sending out a public link to the file, which i dont want. I also found an Middleware for the Version 2.4 of Slim, but I am using 3.x.
I just want to access the Route e.g. /downloads/version/2183
And the a Downlod with this certain File ID should start. I have a Path to the File on the Server in a variable available.
The Basic Idea behind is different restrictions, which user can download the file - but i can do that myself - the problem where I am stuck is, how to bring the Download over the Route to the Clients Browser
Does anyone know how to achieve this?
Cheers,
Niklas
This is actually very easy.
Set the Proper Headers for the file on the Response Object
Read the contents of the file into the body of the Response Object
$app->get('/my/file', function ($req, $res, $args) {
return $res->withHeader('Content-Type', 'application/octet-stream')
->withHeader('Content-Disposition', 'attachment')
->write(file_get_contents("file.txt"));
});

parse.com backend How to list stored files

I'm using parse as my backend and would like to use the rest api to store files.
I've already successfully tested creating new data with the curl request here https://www.parse.com/docs/rest#files Now I would like to see what files I have on my parse.
I don't see any view for these in the data browser. Maybe there's a way to get a listing via a get request? How do I list the files stored on my parse backend?
Note that the column type in the parse data browser will be 'file' denoting 'pointer to a file in the parse CDN'....
treat that like a third party CDN where you also, do not have the 'fileList' capability u ask 4.
live with what u get from the parse browser's inclusion of the pointer, click the field in the browser and , depend on your OS/browser/plugins, it will automatic download/play the file depending on the MIME type you supplied in the headers when u uploaded it.
Remember that you can use the parse dashboard to ask it to delete or GC any files no longer pointed to by active class.rows.
IMO - its not hard to live without what you've asked for as long as you know the other features parse includes with these file type pointers/ refs.

How can i browse file without uploading in GXT?

i'm beginner with GXT and i'm wondering if there is a way to parse a file and extract some informations without uploading it.
i created a formpanel that contains an uploadFile form but i don't know waht's next, how to get the complete path of the file so i can read/write with java io or how to retrieve the file or is there an alternatif solution, thank you.
Best Regards.
You can do it in some modern browsers using bleeding edge HTML5 apis for which you would need to use GWT JSNI code. There are no api's from GWT team as is.
HTML5 FileReader
FileReader includes four options for reading a file, asynchronously:
FileReader.readAsBinaryString(Blob|File) - The result property will contain the file/blob's data as a binary string.
FileReader.readAsText(Blob|File, opt_encoding) - The result property will contain the file/blob's data as a text string.
FileReader.readAsDataURL(Blob|File) - The result property will contain the file/blob's data encoded as a data URL.
FileReader.readAsArrayBuffer(Blob|File) - The result property will contain the file/blob's data as an ArrayBuffer object.
Example of GWT wrapper over these -
https://github.com/bradrydzewski/gwt-filesystem
You can read about it more from here - How to retrieve file from GWT FileUpload component?
IMHO you cannot read it .
Due to security reasons javascript(gwt) doesn't have access to the system drives files.
http://en.wikipedia.org/wiki/JavaScript#Security
see Opening a file in local file system in javascript
In order to get the file you need to make a server call.
Instead you can do your validation server side and throw proper messages to user.
P.S : i am not considering modern browser concept.What happens if someone opened in other than so called modern browsers?? Will the programm runs same?? Its always better to do server side validation..