Solved

A portablity problem

Posted on 1998-11-14
2
138 Views
Last Modified: 2013-11-22
I have to write a servlet that copies a text file from a remote server to the local server. The remote server can be anything - Unix, NT.
How that can be done without using URLs or NFS? I think my problem is the naming convention.
0
Comment
Question by:Gadi031698
2 Comments
 

Author Comment

by:Gadi031698
Comment Utility
Edited text of question
0
 
LVL 16

Accepted Solution

by:
heyhey_ earned 20 total points
Comment Utility
i don't think your problem is the naming convention, but the protocol for transfer of remote data ...
the remote machine manages its own File System and if you want to get some files from there, you will need some kind of server program (working there) that can handle your file request and return the appropriate file(s)

there are many standard protocols for data exchange (FTP, HTTP, even POP3 ...) and the URL object in Java is just a wrapper of the appropriate protocol so if you create HTTP URL object and call getInputStream, the URL object will send the appropriate HTTP request message and will handle the HTTP response message, giving you the pure data. so does FTP URL object ...
(there is no magic at all)

if you are working on LAN with NFS you can probably use File object with appropriate name ...

hope this helps
  heyhey
(if you really don't want to use URL objects, you have to write your own server app. clients should connect to the server (using Sockets) ask for particular file; the server will send them the file and they can save it ...)
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
This video teaches viewers about errors in exception handling.

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now