Java Application Upload to Linux Server - java

i couldnt find any answers to my question yet, so im asking you guys.
Is there a way to do following:
I want to have someone click a button in my Java Application/Program done with JFrame... i got everything setup...now when you click the button it sends a .txt file from you local drive to the linux server, so its in a random folder on the server.
I hope thats possible and not too confusing.
I got a Linux Server and everything setup i just need a way to upload a file to the server.
Yours David

It is absolutely possible. You might need SCP or SFTP Java clients. The one which I used for the similar purpose is com.jcraft.jsch.

Related

Display log file in browser with java script

Hi I'va the next doubt and I want to know if it's possible to implement. I have some wars deployed in a wildfly/jboss server. For some reason, that server doesn't log anything and the administrator of it seems that doesn't want to do his job. So I was wondering if there's a way to see the log of each war in a browser by a frontend design by me.
I think that I can add in each war a log file, but, there's possible to access each file from a browser and see each one? Also there's no need to be in real time.
Help would be appreciated.
Thanks.

Getting the filenames in specific directory on the client machine

First I would like to thank this excellent site for all the help for the developers.
I am facing a problem that I need the user to browse to a specific folder on his/her machine then click the submit button.
I like to get all the filenames and types from this folder and read it in a servlet.
Idon't need upload functionality, I need to read the filenames and types in the selected folder.
Is this possible?
Thanks in advance.
The problem with reading the local file system from a web-page within the browser is the sandbox the browser runs in. Normally, you are not able to get out of that sandbox to read the local file system in such a way.
There are a few way around that, for Java you could use a signed applet, or you could use an signed ActiveX control.
Both shouldn't be that difficult, but the Java applet will have a better support all round, since the ActiveX only works on windows.
It's the signing that will become the real problem though. Is this something in a contained environment, or for the actual internet for everyone there to be able to use?
If it's a contained environment, you might be able to pull it off using a self signed certificate. Else you will need a certificate from an actual certificate authority. These can get pretty expensive.

How to open an .exe file using gwt?

I am using gwt to develop java project. I want to open .exe file that is installed on client machine. I have searched on internet but didn't find a suitable solution.
You cannot access any files on a user's computer from a web browser. Otherwise, every computer in the world could be be easily hacked.
You can offer a user to install a program, and then ask this user to start this program, but you cannot install and run this program yourself.
No its not possible
At least it is not specific for GWT in comparison with other Javascript ways to do this. i.e : If there is a way to do this then it is a huge bug and security flaw in the browser.
You can offer the file for download and let the user execute it. But I guess that is not what you want.

Is it Possible to Create temporary directory & store temporary images on Client Side?

I am new to Java & i am trying to make a Web Application which can access Client Images ,
so firstly i want to know that is it possible to create a folder in Clients temporary directory or in other drive and keep my temporary images their.
Please help me to understand the possibility of what i am trying to make.
Thanks in advance.
You need applets.
Here is some thread which gives some code of applet like one you need.
https://community.oracle.com/message/9960696#9960696
There are also some problems which author of this topic has and their resolutions.
Here is some tutorial on youtube just to start (I'm not sure if this is up to date): https://www.youtube.com/watch?v=mDDeoqKcnGc
And tutorial from Oracle's page: http://docs.oracle.com/javase/tutorial/deployment/applet/
Good luck
PS. Spring and java-ee has nothing to do with your problem since it is server side. You need client side solution. Applets or Flash or Silverlight or ...

run a java class file using php

I have java class file (server.class) I want to run this file to client machine using php.
My approach
download the file from server to client machine
run this file in client machine
close the cmd and delete the file after on pressing another button
tell me my approach is right or I am making it more complex.If it is complex the then suggest me what is the right approach?
You cannot run programs on a client's machine. You can provide a download link and instructions on how to run it.
If you want to avoid the client having to click a download button, all I can think of is implementing server.class as an applet inside a web page or maybe using webstart, but I don't know much about webstart, and either way the client will go through a process of agreeing to run the java code.
Also, it sounds like some shady, shady stuff you're attempting to do. I hope you're not trying to run something on a person's computer without them knowing. If that is the case... I WILL find you :P

Categories

Resources