How can I trasfer file using java program (from NT to Unix)
Hi all,
I want to transfer a text file from Windows NT to Unix machine inside the Java program.
How should i do it.
Thanks in advance.
Regards
Rajeev
you have several options:
- make your system administrator software install software on Unix and NT so that you can see a directory on the Unix machine from your NT machine, and just copy the file there
- use FTP to put the file on the Unix machine
Jesper
Similar Messages
-
How to uncompress zip files using java program
hai,
please give some sample code to decompress the zip file.
how to uncompress zip files using java program
thanking you
arivarasuhttp://developer.java.sun.com/developer/technicalArticles/Programming/PerfTuning/
Scroll down to 'Compression' -
Help--How can I open only one java program at one time?
How can I open only one java program(same program) in Windows at one time?
In Java 1.5, you can use the JVM's own monitoring APIs to examine what other JVMs are running on the system, and what applications they're running.
It's general and powerful, but complex. The socket/file/whatever approach is cleaner, and probably more suited to your usage.
Don't bother trying to use the Windows task manager for this sort of thing. You have to write messy native code, and it isn't reliable after all that anyway. -
Zip and extract multiple files using java program
how can i zip and extract multiple files using java program.
Hi,
Look into the java.util.zip and java.util.jar they expose methods to manipulate zip and jar files. -
How to read system eventlog using java program in windows?
How to read system eventlog using java program in windows?
is there any java class available to do this ? or any one having sample code for this?
Your friend ZoeHi,
There is no java class for reading event log in windows, so we can do one thing we can use windows system 32 VBS script to read the system log .
The output of this command can be read using java program....
we can use java exec for executing this system32 vbs script.
use the below program and pass the command "eventquery"
plz refer cscript,wscript
import java.io.*;
public class CmdExec {
public static void main(String argv[]) {
try {
String line;
Process p = Runtime.getRuntime().exec("Command");
BufferedReader input =
new BufferedReader
(new InputStreamReader(p.getInputStream()));
while ((line = input.readLine()) != null) {
System.out.println(line);
input.close();
catch (Exception err) {
err.printStackTrace();
This sample program will list all the system log information....
Zoe -
How to run .jar on linux & how to create .jar file using java?
hi, may i know how to run .jar on linux & how to create .jar file using java? Can u provide the steps on doing it.
thanks in advance.Look at the manual page for jar:
# man jar
Also you can run them by doing:
# java -jar Prog.jar -
How to print PDF files using java print API
Hi,
I was goign throw lot of discusion and reading lot of forums related to print pdf files using java api. but nothing seems to be working for me. Can any one tell me how to print pdf files using java api.
Thanks in advanceMike,
Can't seem to get hold of the example described in your reply below. If you could let us have the URL to get then it would be great.
My GUI application creates a pdf document which I need to print. I want to achieve this using the standard Java class PrinterJob (no 3rd party APIs I'm afraid, commercial restraints etc ..). I had a stab at it using the following code. When executed I get the pretty printer dialog then when I click ok to print, nothing happens!
boolean showPrintDialog=true;
PrinterJob printJob = PrinterJob.getPrinterJob ();
printJob.setJobName ("Contract.pdf");
try {
if (showPrintDialog) {
if (printJob.printDialog()) {
printJob.print();
else
printJob.print ();
} catch (Exception PrintException) {
PrintException.printStackTrace();
Thank you and a happy new year.
Cheers,
Chris -
How to open/read file using Java in Unix?
Hi Friends,
Can you please help me out how to open/read file using java in unix os? I have create one text file in "/home/test.txt" in unix environment. How to open the same file & read using java code?
- Hiren Modihttp://java.sun.com/docs/books/tutorial/essential/io/index.html
-
How to read system evenlog using java program in windows
How to read system evenlog using java program in windows???
is there any java class available to do this ? or any one having sample code for this?
Your friend ZoeWelcome to the Sun forums.
>
How to read system evenlog using java program in windows???>
JNI. (No.)
>
is there any java class available to do this ? or any one having sample code for this?>You will generally get better help around here if you read the documentation, try some sample code and come back with a specific question (hopefully with an SSCCE included).
>
Your friend Zoe>(raised eyebrow) Thank you for sharing that with us.
Note also that one '?' denotes a question, while 2 or more generally denotes a dweeb. -
How can I access files that I moved from an older MacBook Pro to a newer one via Firewire and Migration assistant? The files show up on the new MacBook but cannot be opened. Thanks!
Get info then check permissions then add your curent user name (it was probably different on old Mac) and give your username full read/write permissions.
-
HT5517 How can have full picture using mirrored image from iPad
How can have full picture using mirrored image from iPad on my Apple TV airplay
Welcome to the Apple Community.
Mirroring won't fill the TV screen. The iPad has an aspect ratio of 4:3 and the iPhone 4S or prior an aspect ratio of 3:2, neither of these will fit exactly into a TV screen which as an aspect ratio of 16:9. The Apple TV will not zoom the mirrored image, because it may well cut off information which is situated at the top or bottom of the screen.
You may wish to try each of the settings in ‘Settings > Audio & Video > Adjust for AirPlay overscan’ for the best setting that suits you. -
Can we run EXE file/ Another Java Program from Java Application? How?
Can we run EXE file and another java program from java application?
Thanks in advanceExample running adobe acrobat
String command = "C:\\Program Files\\Adobe\\Acrobat 5.0\\Reader\\AcroRd32.exe /t "+selectedDocument+" \\\\CONTROL\\HP LaserJet 4L";
Runtime rn = Runtime.getRuntime();
Process process = rn.exec(command);
process.waitFor();rykk -
How to read pdf files using java.io package classes
Dear All,
I have a certain requirement that i should read and write PDF files at runtime. With normal java file IO reading is not working. Can any one suggest me how to proceed probably with sample code block
Thanks in advance.hi I also have the pbm. to read pdf file using JAVA
can any body help meWhy is it so difficult to read the thread you posted in? They say: java.io is pointless, use iText. So why don't you?
or also I want to read a binary encoded data into
ascii,
can anybody give me a hint how to do it.Depends on what you mean with "binary encoding". ASCII's binary encoding, too, basically. -
Friends,
I want to gzip a file in unix using my java program, can I use Runtime.exec() method and run the gzip command to achieve this ?
Is there any other way to zip/compress a file using java api ?
ThanksUse [url http://java.sun.com/j2se/1.5.0/docs/api/java/util/zip/GZIPOutputStream.html]java.util.zip.GZIPOutputStream along with [url http://java.sun.com/j2se/1.5.0/docs/api/java/io/FileOutputStream.html]java.io.FileOutputStream
-
How to open specific port using java program
Hello,
I want to open ,close port using java comm.plz help me how can i do it.is it possible
by using java program.later i want to use that specific port to accept the server socket connection .plz
help me.i try this java program.*but it get block in accept method*.tht mean i m not able to make connection with port.
import java.sql.SQLException;
import java.io.IOException;
import java.net.ServerSocket;
import java.util.logging.Level;
import java.util.logging.Logger;
class MakeConn
public final static int PORT = 7788;
public static java.net.Socket clientSocket = null;
public static java.io.PrintWriter pw = null; // socket output stream
public static java.io.BufferedReader br = null;
public static ServerSocket server_socket;
public static void main(String[] args) throws SQLException
try {
server_socket = new ServerSocket(PORT);
clientSocket = server_socket.accept();
System.out.println("CLIENT>>>" + clientSocket);
br = new java.io.BufferedReader(new java.io.InputStreamReader(clientSocket.getInputStream()));
pw = new java.io.PrintWriter(clientSocket.getOutputStream(), true);
String message = br.readLine().trim();
System.out.println("message is"+message);
pw.close(); // close everything
br.close();
clientSocket.close();
catch (Exception ex) {
ex.printStackTrace();
}
Maybe you are looking for
-
Pull random images from iPhoto library folders
I'm trying to come up with a script to pull random images from my iPhoto library and copy them to another folder that I can then use with another program (GeekTool) to display them on my desktop. What I'd like to be able to do is pull 30-50 of these
-
Drafts Not Available for Publish
Using Contribute CS3 and CPS. Draft is sent for review. It is reviewed by the admin. Admin goes to "publish" and Contribute says that the Draft is not available to publish. The person who created the draft - his PC was on. Any ideas on why this happe
-
WD4A for Mobile....!
Hi SDN, Can we develope Web dynpro application for ABAP for mobile? i.e. can we develope mobile web dynpro.. please send me some examples regarding it.... How to test the web dynpro for ABAP on mobile... Thanks in advance, Rahul Wagh.
-
After Effects Render H.264 Warning
Hello, I am trying to build an animation for an airport signage display. Here are the specs 3240 x 3840 Resolution, 10 secs, must be a H.264 MOV file. I built everything in After Effects and go to render. When I select the H.264 Render option I get a
-
Everything is gone and i'm freaking out
I just downloaded itunes version 8.0.2.20 and when I open up itunes, everything is gone. . . my music, my movies, podcasts, even purchase history, its completely gone. I'm not very computer savvy and i'm really worried that I wont be able to get my t